SDK reference
mp_sdk.training.ImageAnnotation
class mp_sdk.training.ImageAnnotation(*,
id: int,
label_id: int,
contour: List[List[float]],
bounding_box: Tuple
)
Image annotation object.
Represents a single annotation provided by the application user. Usually used with mp_sdk.training.AnnotatedImage object.
All coordinate points provided in the bounding_box and contour attributes are relative to the image size, meaning that the coordinates are in range from 0 to 1 representing the percentage of the image size.
Attributes
id - int: The annotation ID, unique within AnnotatedImage.annotations list.
label_id - int: The label ID refencing a label from TrainingSession.annotation_labels list.
contour - List[List[float]]: Points of the annotation contour list of
[(x, y)]tuples.bounding_box - Tuple[float, float, float, float]: The bounding box of the annotation with [
min_x,min_y,max_x,max_y] values.yolov5_annotation - str: Annotation in YOLO format returned as a string.