fix: 🐞 doc and validation typo fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
parent
099258baa6
commit
3676f07168
|
|
@ -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}"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue