fix: 🐞 add check if keypoints size is 0 return empty keypoint result

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER
2024-07-11 04:41:29 +03:00
parent 185ae462a4
commit 13fe6e0942
+2
View File
@@ -448,6 +448,8 @@ class KeyPoints:
"""
if hasattr(detectron2_results["instances"], "pred_keypoints"):
if detectron2_results["instances"].pred_keypoints.cpu().numpy().size == 0:
return cls.empty()
return cls(
xy=detectron2_results["instances"]
.pred_keypoints.cpu()