class documentation
class BBoxAnnotation(Annotation):
Bounding box annotation.
Values are normalized based on the image size.
| Static Method | combine |
Combine bounding box annotations into rows with class IDs. |
| Method | to |
Convert the bounding box annotation to row format. |
| Instance Variable | h |
Normalized bounding box height. |
| Instance Variable | w |
Normalized bounding box width. |
| Instance Variable | x |
Normalized top-left x coordinate. |
| Instance Variable | y |
Normalized top-left y coordinate. |
| Class Method | _validate |
Undocumented |
| Static Method | _clip |
Undocumented |
@staticmethod
@override
def combine_to_numpy(annotations: @override
list[ BBoxAnnotation], classes: list[ int], n_classes: int | None = None) -> np.ndarray:
¶
Combine bounding box annotations into rows with class IDs.
| Parameters | |
annotations:list[ | Bounding box annotations to combine. |
classes:list[ | Class IDs associated with the annotations. |
nint | None | Unused class count kept for API compatibility. |
| Returns | |
np.ndarray | An array of shape (N, 5) where N is the number of bounding box annotations and each row is in the format [class_id, x, y, w, h]. |
Convert the bounding box annotation to row format.
| Parameters | |
classint | The numeric class ID of the annotation. |
| Returns | |
np.ndarray | An array of shape (5, ) in the format [class_id, x, y, w, h]. |
@model_validator( mode='before')
@classmethod
def _validate_values(cls, values: @classmethod
dict[ str, Any]) -> dict[ str, Any]:
¶
Undocumented