fix: 🐞 doc and validation typo fix

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER committed 2024-06-26 15:51:32 +03:00
1 parent 099258baa6
commit 3676f07168
2 files changed
+6 -5

No files matched your search

+5 -3
View File
@@ -443,13 +443,15 @@ class KeyPoints:
predictor = DefaultPredictor(cfg)
result = predictor(image)
keypoints = sv.Keypoints.from_detectron2(result)
keypoints = sv.KeyPoints.from_detectron2(result)
```
"""
if hasattr(detectron2_results["instances"], "pred_keypoints"):
return cls(
xy=detectron2_results["instances"].pred_keypoints.cpu().numpy()[:, :, :2],
xy=detectron2_results["instances"]
.pred_keypoints.cpu()
.numpy()[:, :, :2],
confidence=detectron2_results["instances"]
.pred_keypoints.cpu()
.numpy()[:, :, 2:],
+1 -2
View File
@@ -62,8 +62,7 @@ def validate_keypoint_confidence(confidence: Any, n: int, m: int) -> None:
if not is_valid:
raise ValueError(
f"confidence must be a 1D np.ndarray with shape {expected_shape}, but "
"got"
f"shape {actual_shape}"
f"got shape {actual_shape}"
)