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:
parent
185ae462a4
commit
13fe6e0942
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue