`ultralytics 8.2.100` new YOLOv8-OBB object counting (#16437)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/7550/head^2 v8.2.100
Muhammad Rizwan Munawar 2 months ago committed by GitHub
parent b4d544a0f9
commit ba949830bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/__init__.py
  2. 11
      ultralytics/solutions/object_counter.py

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.2.99"
__version__ = "8.2.100"
import os

@ -127,10 +127,13 @@ class ObjectCounter:
# Draw region or line
annotator.draw_region(reg_pts=self.reg_pts, color=(104, 0, 123), thickness=self.tf * 2)
if tracks[0].boxes.id is not None:
boxes = tracks[0].boxes.xyxy.cpu()
clss = tracks[0].boxes.cls.cpu().tolist()
track_ids = tracks[0].boxes.id.int().cpu().tolist()
# Extract tracks for OBB or object detection
track_data = tracks[0].obb or tracks[0].boxes
if track_data and track_data.id is not None:
boxes = track_data.xyxy.cpu()
clss = track_data.cls.cpu().tolist()
track_ids = track_data.id.int().cpu().tolist()
# Extract tracks
for box, track_id, cls in zip(boxes, track_ids, clss):

Loading…
Cancel
Save