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

@ -23,7 +23,6 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
| ![Conveyor Belt Packets Counting Using Ultralytics YOLOv8](https://github.com/RizwanMunawar/ultralytics/assets/62513924/70e2d106-510c-4c6c-a57a-d34a765aa757) | ![Fish Counting in Sea using Ultralytics YOLOv8](https://github.com/RizwanMunawar/ultralytics/assets/62513924/c60d047b-3837-435f-8d29-bb9fc95d2191) |
| Conveyor Belt Packets Counting Using Ultralytics YOLOv8 | Fish Counting in Sea using Ultralytics YOLOv8 |
!!! Example "Object Counting Example"
=== "Object Counting"
@ -34,9 +33,7 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
model = YOLO("yolov8n.pt")
cap = cv2.VideoCapture("path/to/video/file.mp4")
if not cap.isOpened():
print("Error reading video file")
exit(0)
assert cap.isOpened(), "Error reading video file"
counter = object_counter.ObjectCounter() # Init Object Counter
region_points = [(20, 400), (1080, 404), (1080, 360), (20, 360)]
@ -61,9 +58,7 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
model = YOLO("yolov8n.pt")
cap = cv2.VideoCapture("path/to/video/file.mp4")
if not cap.isOpened():
print("Error reading video file")
exit(0)
assert cap.isOpened(), "Error reading video file"
classes_to_count = [0, 2]
counter = object_counter.ObjectCounter() # Init Object Counter
@ -91,9 +86,7 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
model = YOLO("yolov8n.pt")
cap = cv2.VideoCapture("path/to/video/file.mp4")
if not cap.isOpened():
print("Error reading video file")
exit(0)
assert cap.isOpened(), "Error reading video file"
video_writer = cv2.VideoWriter("object_counting.avi",
cv2.VideoWriter_fourcc(*'mp4v'),
@ -134,7 +127,6 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
| track_thickness | `int` | `2` | Tracking line thickness |
| draw_tracks | `bool` | `False` | Draw Tracks lines |
### Arguments `model.track`
| Name | Type | Default | Description |