fix: 🐞 doc and validation typo fix

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER 2024-06-26 15:51:32 +03:00
parent 099258baa6
commit 3676f07168
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
2 changed files with 6 additions and 5 deletions

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:],

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}"
)