class documentation
class KeypointAnnotation(Annotation):
Keypoint annotation.
The coordinates are normalized to [0, 1] based on the image size.
| Static Method | combine |
Combine keypoint annotations into flattened keypoint rows. |
| Method | to |
Convert the keypoint annotation to flattened row format. |
| Instance Variable | keypoints |
Keypoints in (x, y, visibility) format. Visibility follows the COCO convention: |
| Class Method | _validate |
Undocumented |
@staticmethod
@override
def combine_to_numpy(annotations: @override
list[ KeypointAnnotation], classes: list[ int] | None = None, n_classes: int | None = None) -> np.ndarray:
¶
Combine keypoint annotations into flattened keypoint rows.
| Parameters | |
annotations:list[ | Keypoint annotations to combine. |
classes:list[ | Unused class IDs kept for API compatibility. |
nint | None | Unused class count kept for API compatibility. |
| Returns | |
np.ndarray | An array of shape (N, 3K) where N is the number of keypoint annotations and K is the number of keypoints per annotation. Flattened keypoint rows. Each row contains keypoint coordinates and visibility in the format [x1, y1, v1, x2, y2, v2, …] where (xi, yi, vi) are the coordinates and visibility of the i-th keypoint. |
Convert the keypoint annotation to flattened row format.
| Returns | |
np.ndarray | An array of shape (3K, ) where K is the number of keypoints. The format of the array is [x1, y1, v1, x2, y2, v2, …] where (xi, yi, vi) are the coordinates and visibility of the i-th keypoint. |
Keypoints in (x, y, visibility) format. Visibility follows the COCO convention:
- 0: Not visible or not labeled.
- 1: Occluded.
- 2: Visible.
@model_validator( mode='before')
@classmethod
def _validate_values(cls, values: @classmethod
dict[ str, Any]) -> dict[ str, Any]:
¶
Undocumented