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:
parent
0f5406ec21
commit
2b49d71772
15 changed files with 225 additions and 145 deletions
|
|
@ -23,7 +23,6 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
|
|||
|  |  |
|
||||
| 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 |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue