fix: 🐞 doc and validation typo fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
2 files changed
+6
-5
No files matched your search
@@ -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:],
|
||||
|
||||
@@ -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}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user