Fix keypoint crash with no detections

This commit is contained in:
Linas Kondrackis committed 2024-04-24 14:59:57 +03:00
1 parent 80e5413402
commit 4b89bece4f
1 file changed
+1 -1
+1 -1
View File
@@ -135,7 +135,7 @@ class KeyPoints:
keypoints = sv.KeyPoints.from_ultralytics(result)
```
"""
if len(ultralytics_results.keypoints.xy) == 0:
if ultralytics_results.keypoints.xy.numel() == 0:
return cls.empty()
xy = ultralytics_results.keypoints.xy.cpu().numpy()