From 1618c69d13753b43789ce50307ec2f1c717d020a Mon Sep 17 00:00:00 2001 From: Muhammad Rizwan Munawar Date: Thu, 5 Dec 2024 23:57:09 +0500 Subject: [PATCH] Update functions description (#18050) --- ultralytics/solutions/heatmap.py | 8 ++------ ultralytics/solutions/queue_management.py | 11 +++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ultralytics/solutions/heatmap.py b/ultralytics/solutions/heatmap.py index c9dd8087..bf2903b7 100644 --- a/ultralytics/solutions/heatmap.py +++ b/ultralytics/solutions/heatmap.py @@ -27,12 +27,8 @@ class Heatmap(ObjectCounter): Examples: >>> from ultralytics.solutions import Heatmap >>> heatmap = Heatmap(model="yolov8n.pt", colormap=cv2.COLORMAP_JET) - >>> results = heatmap("path/to/video.mp4") - >>> for result in results: - ... print(result.speed) # Print inference speed - ... cv2.imshow("Heatmap", result.plot()) - ... if cv2.waitKey(1) & 0xFF == ord("q"): - ... break + >>> frame = cv2.imread("frame.jpg") + >>> processed_frame = heatmap.generate_heatmap(frame) """ def __init__(self, **kwargs): diff --git a/ultralytics/solutions/queue_management.py b/ultralytics/solutions/queue_management.py index ca0acb14..043bd371 100644 --- a/ultralytics/solutions/queue_management.py +++ b/ultralytics/solutions/queue_management.py @@ -27,10 +27,13 @@ class QueueManager(BaseSolution): display_output: Displays the processed output. Examples: - >>> queue_manager = QueueManager(source="video.mp4", region=[100, 100, 200, 200, 300, 300]) - >>> for frame in video_stream: - ... processed_frame = queue_manager.process_queue(frame) - ... cv2.imshow("Queue Management", processed_frame) + >>> cap = cv2.VideoCapture("Path/to/video/file.mp4") + >>> queue_manager = QueueManager(region=[100, 100, 200, 200, 300, 300]) + >>> while cap.isOpened(): + >>> success, im0 = cap.read() + >>> if not success: + >>> break + >>> out = queue.process_queue(im0) """ def __init__(self, **kwargs):