ultralytics 8.0.224 Counting and Heatmaps updates (#6855)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Muhammad Rizwan Munawar <chr043416@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-12-08 02:34:32 +01:00 committed by GitHub
parent 0f5406ec21
commit 2b49d71772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 225 additions and 145 deletions

View file

@ -119,7 +119,8 @@ class ObjectCounter:
# Draw Tracks
track_line = self.track_history[track_id]
track_line.append((float((box[0] + box[2]) / 2), float((box[1] + box[3]) / 2)))
track_line.pop(0) if len(track_line) > 30 else None
if len(track_line) > 30:
track_line.pop(0)
if self.draw_tracks:
self.annotator.draw_centroid_and_tracks(track_line,