Annotation

class scenebox.models.annotation.Annotation(**kwargs)

Base annotation class. Inherited by all *Annotation classes.

Only specify one of asset/image/video/lidar_id.

Keyword Arguments:
  • asset_id (Optional[str]) – ID of the existing asset to associate with the annotation.

  • image_id (Optional[str]) – ID of the existing image to associate with the annotation.

  • video_id (Optional[str]) – ID of the existing video to associate with the annotation.

  • lidar_id (Optional[str]) – ID of the existing lidar to associate with the annotation.

  • media_type (Optional[str]) – Media type (image, object, etc.) of the asset specified in asset/image/video/lidar_id. Choose from scenebox.constants.AnnotationMediaTypes.VALID_TYPES.

  • annotation_type (Optional[str]) – Annotation type (bounding box, polygon, etc.). Choose from scenebox.constants.AnnotationTypes.VALID_TYPES.

  • provider (Optional[str]) – The name of the annotation model or source.

  • annotation_entities (Optional[AnnotationEntity]) – Annotation objects. Not necessary to fill when using the Point/PointAnnotation, BoundingBox/BoundingBoxAnnotation, etc. wrapper classes, and necessary otherwise. Using this argument bypasses all argument validity pre-checks.

  • annotation_meta (Optional[Dict[str, Any]]) – Any primary annotation metadata.

  • sets (Optional[List[str]]) – Dataset IDs to associate with the annotation.

  • session_uid (Optional[str]) – Session UID to associate with the annotation.

  • sensor (Optional[str]) – The sensor with which the annotation was captured with.

  • version (Optional[str]) – The annotation model version.

  • annotation_group (Optional[str]) – The annotation source type (GT, Model, etc.) Choose from scenebox.constants.AnnotationGroups.

  • masks (Optional[Dict[str, ObjectAccess]]) – All mask ObjectAccess objects. Helps SceneBox to access valid addresses for the mask image files.

  • tags (Optional[List[str]]) – Any tags to associate with the annotation.

  • frame (Optional[int]) – Video frame number associated with the annotation. Must be specified if annotating video.

  • aux (Optional[List[str]]) – Any auxiliary annotation metadata.

  • raw_annotation_str (Optional[str]) – string payload of the raw annotation

  • raw_annotation_json (Optional[JSON]) – json payload of the raw annotation

  • raw_annotation_url (Optional[str]) – url of the raw annotation

  • raw_annotation_uri (Optional[str]) – uri of the raw annotation

Methods

to_dic

return a dictionary object representative of Annotation :return: dictionary object

to_dic()

return a dictionary object representative of Annotation :return: dictionary object