`ultralytics 8.2.6` fix `HUBDatasetStats.get_json()` for empty keypoints (#10415)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/10389/head^2 v8.2.6
Laughing 7 months ago committed by GitHub
parent bbfca94467
commit 6beccb6b5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/__init__.py
  2. 4
      ultralytics/data/utils.py

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.2.5"
__version__ = "8.2.6"
from ultralytics.data.explorer.explorer import Explorer
from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld

@ -500,8 +500,8 @@ class HUBDatasetStats:
elif self.task == "segment":
coordinates = [x.flatten() for x in labels["segments"]]
elif self.task == "pose":
n = labels["keypoints"].shape[0]
coordinates = np.concatenate((labels["bboxes"], labels["keypoints"].reshape(n, -1)), 1)
n, nk, nd = labels["keypoints"].shape
coordinates = np.concatenate((labels["bboxes"], labels["keypoints"].reshape(n, nk * nd)), 1)
else:
raise ValueError("Undefined dataset task.")
zipped = zip(labels["cls"], coordinates)

Loading…
Cancel
Save