Skip to main content

_AnnotationMetadata Objects

@dataclass
class _AnnotationMetadata()
Contains metadata information about an annotation (on a frame or a range)

created_by

None defaults to the user of the SDK once uploaded to the server.

last_edited_by

None defaults to the user of the SDK once uploaded to the server.

from_dict

@staticmethod
def from_dict(
    d: BaseFrameObject | FrameClassification | ClassificationAnswer
) -> "_AnnotationMetadata"
Create a AnnotationInfo instance from a dictionary. Arguments:
  • d - A dictionary containing information about the annotation.
Returns:
  • AnnotationInfo - An instance of AnnotationInfo.

update_from_optional_fields

def update_from_optional_fields(
        *,
        created_at: Optional[datetime] = None,
        created_by: Optional[str] = None,
        last_edited_at: Optional[datetime] = None,
        last_edited_by: Optional[str] = None,
        confidence: Optional[float] = None,
        manual_annotation: Optional[bool] = None,
        is_deleted: Optional[bool] = None,
        reviews: Optional[List[Dict[Any, Any]]] = None) -> None
Update the AnnotationInfo fields with the specified values. Arguments:
  • created_at - Optional creation time.
  • created_by - Optional creator identifier.
  • last_edited_at - Optional last edited time.
  • last_edited_by - Optional last editor identifier.
  • confidence - Optional confidence value.
  • manual_annotation - Optional manual annotation flag.
  • reviews - Optional list of reviews.
  • is_deleted - Optional deleted flag.

_Annotation Objects

class _Annotation(ABC)
Class providing common annotation properties.

frame

@property
@abstractmethod
def frame() -> int
int: Gets the frame number. Notes: This is a legacy attribute. For new subclasses where frame is not applicable (e.g. audio and text), this returns 0.

space

@property
@abstractmethod
def space() -> Space
Get the space that this annotation is on.

created_at

@property
def created_at() -> datetime
Get the creation timestamp of the annotation.

created_at

@created_at.setter
def created_at(created_at: datetime) -> None
Set the creation timestamp of the annotation.

created_by

@property
def created_by() -> Optional[str]
Get the email of the user who created the annotation.

created_by

@created_by.setter
def created_by(created_by: Optional[str]) -> None
Set the creator email. None defaults to the current SDK user. Arguments:
  • created_by - User email or None to default to SDK user.
Raises:
  • ValueError - If the email format is invalid.

last_edited_at

@property
def last_edited_at() -> datetime
Get the last edited timestamp of the annotation.

last_edited_at

@last_edited_at.setter
def last_edited_at(last_edited_at: datetime) -> None
Set the last edited timestamp of the annotation.

last_edited_by

@property
def last_edited_by() -> Optional[str]
Get the email of the user who last edited the annotation.

last_edited_by

@last_edited_by.setter
def last_edited_by(last_edited_by: Optional[str]) -> None
Set the last editor email. None defaults to the current SDK user. Arguments:
  • last_edited_by - User email or None to default to SDK user.
Raises:
  • ValueError - If the email format is invalid.

confidence

@property
def confidence() -> float
Get the confidence score of the annotation.

confidence

@confidence.setter
def confidence(confidence: float) -> None
Set the confidence score of the annotation.

manual_annotation

@property
def manual_annotation() -> bool
Get whether this annotation was created manually.

manual_annotation

@manual_annotation.setter
def manual_annotation(manual_annotation: bool) -> None
Set whether this annotation was created manually.

_ObjectAnnotation Objects

class _ObjectAnnotation(_Annotation)
Represents an object annotation on a Space. Provides access to annotation metadata for a SpaceObject.

object_hash

@property
def object_hash() -> str
Get the hash of the object instance.

coordinates

@property
@abstractmethod
def coordinates() -> Coordinates
coordinates: Gets the frame number. Notes: This is a legacy attribute. For new subclasses where coordinates are not applicable, do not use this attribute. Instead, use .ranges instead (e.g. for audio or text spaces)

_ClassificationAnnotation Objects

class _ClassificationAnnotation(_Annotation)
Represents a classification annotation on a Space. Allows setting or getting annotation data for the Classification.

classification_hash

@property
def classification_hash() -> str
Get the hash of the object instance.