from .bounding_box import BoundingBox
from typing import Protocol, runtime_checkable
[docs]
@runtime_checkable
class AnnotationProtocol(Protocol):
"""
Protocol representing the abstract structure of an annotation.
This protocol defines both Annotation and RandomAnnotation.
Attributes:
gt_name (str): Name of the Ground Truth dataset this annotation belongs to.
id (str): Unique identifier for the annotation.
category_id (int): Category ID of the annotated object.
image_id (str): Identifier of the image containing the annotation.
bbox_coords (BoundingBox): Bounding box coordinates of the annotation.
unit_id (int): Identifier of the unit this annotation belongs to (if units were computed).
"""
# Ground Truth properties
gt_name: str
# Annotation properties
id: str
category_id: int
image_id: str
bbox_coords: BoundingBox
# Additional properties
unit_id: int