Reference for ultralytics/solutions/queue_management.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/queue_management.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.solutions.queue_management.QueueManager
A class to manage the queue in a real-time video stream based on object tracks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names |
dict
|
A dictionary mapping class IDs to class names. |
required |
reg_pts |
list of tuples
|
Points defining the counting region polygon. Defaults to a predefined rectangle. |
None
|
line_thickness |
int
|
Thickness of the annotation lines. Defaults to 2. |
2
|
view_img |
bool
|
Whether to display the image frames. Defaults to False. |
False
|
draw_tracks |
bool
|
Whether to draw tracks of the objects. Defaults to False. |
False
|
Source code in ultralytics/solutions/queue_management.py
extract_and_process_tracks
Extracts and processes tracks for queue management in a video stream.
Source code in ultralytics/solutions/queue_management.py
process_queue
Main function to start the queue management process.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
im0 |
ndarray
|
Current frame from the video stream. |
required |
tracks |
list
|
List of tracks obtained from the object tracking process. |
required |