From 6beccb6b5ed760c2149cc49b874bc825d70097c3 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Wed, 1 May 2024 21:59:36 +0800 Subject: [PATCH] `ultralytics 8.2.6` fix `HUBDatasetStats.get_json()` for empty keypoints (#10415) Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/data/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 45d7f35663..78a48007f7 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.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 diff --git a/ultralytics/data/utils.py b/ultralytics/data/utils.py index 78414263dd..bd63cb268f 100644 --- a/ultralytics/data/utils.py +++ b/ultralytics/data/utils.py @@ -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)