Fix queue `counts` (#15971)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Muhammad Rizwan Munawar <muhammadrizwanmunawar123@gmail.com>
Co-authored-by: RizwanMunawar <chr043416@gmail.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
action-recog
TechWolf21 3 months ago committed by fcakyon
parent 0f4624d294
commit d223044099
  1. 3
      ultralytics/solutions/queue_management.py

@ -89,7 +89,7 @@ class QueueManager:
"""Extracts and processes tracks for queue management in a video stream.""" """Extracts and processes tracks for queue management in a video stream."""
# Initialize annotator and draw the queue region # Initialize annotator and draw the queue region
self.annotator = Annotator(self.im0, self.tf, self.names) self.annotator = Annotator(self.im0, self.tf, self.names)
self.counts = 0 # Reset counts every frame
if tracks[0].boxes.id is not None: if tracks[0].boxes.id is not None:
boxes = tracks[0].boxes.xyxy.cpu() boxes = tracks[0].boxes.xyxy.cpu()
clss = tracks[0].boxes.cls.cpu().tolist() clss = tracks[0].boxes.cls.cpu().tolist()
@ -132,7 +132,6 @@ class QueueManager:
txt_color=self.count_txt_color, txt_color=self.count_txt_color,
) )
self.counts = 0 # Reset counts after displaying
self.display_frames() self.display_frames()
def display_frames(self): def display_frames(self):

Loading…
Cancel
Save