Update distance-calculation solution (#16907)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
1052cf41f8
commit
8e3846d377
6 changed files with 41 additions and 106 deletions
|
|
@ -112,13 +112,13 @@ class ObjectCounter(BaseSolution):
|
|||
# Iterate over bounding boxes, track ids and classes index
|
||||
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
||||
# Draw bounding box and counting region
|
||||
self.annotator.box_label(box, label=self.names[cls], color=colors(track_id, True))
|
||||
self.annotator.box_label(box, label=self.names[cls], color=colors(cls, True))
|
||||
self.store_tracking_history(track_id, box) # Store track history
|
||||
self.store_classwise_counts(cls) # store classwise counts in dict
|
||||
|
||||
# Draw tracks of objects
|
||||
self.annotator.draw_centroid_and_tracks(
|
||||
self.track_line, color=colors(int(track_id), True), track_thickness=self.line_width
|
||||
self.track_line, color=colors(int(cls), True), track_thickness=self.line_width
|
||||
)
|
||||
|
||||
# store previous position of track for object counting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue