Skip to content

Schema Names

Under the hood, t4-devkit declares an enum called SchemaName. This enum includes names of each schema table that should be contained in the T4 dataset as .json file.

Note that some schema tables are not mandatory, such as object_ann.json and surface_ann.json. For these tables, the method called is_optional() returns True and it is OK that these corresponding .json files are not contained in T4 dataset:

from t4_devkit.schema import SchemaName

>>> SchemaName.OBJECT_ANN.is_optional()
True

SchemaName

An enum to represent schema filenames.

Attributes:

Name Type Description
ATTRIBUTE

Property of an instance that can change while the category remains the same.

CALIBRATED_SENSOR

Definition of a particular sensor as calibrated on a vehicle.

CATEGORY

Object categories.

EGO_POSE

Ego vehicle pose at at particular timestamp.

INSTANCE

An object instance.

LOG

Information about the log from which the data aws extracted.

MAP

Map data that is stored as binary semantic masks from a top-down view.

SAMPLE

A sample is an annotated keyframe at specific Hz.

SAMPLE_ANNOTATION

A bounding box defining the position of an object seen in a sample.

SAMPLE_DATA

A sensor data e.g. image, pointcloud or radar return.

SCENE

A scene is a specific long sequence of consecutive frames extracted from a log.

SENSOR

A specific sensor type.

VISIBILITY

The visibility of instance is the fraction of annotation visible in all images.

LIDARSEG optional

The annotation of 3D point cloud segmentation.

OBJECT_ANN optional

The annotation of a foreground object in an image.

SURFACE_ANN optional

The annotation of a background object in an image.

KEYPOINT optional

The annotation of pose keypoints of an object in an image.

VEHICLE_STATE optional

The annotation of ego vehicle states.

Source code in t4_devkit/schema/name.py
@unique
class SchemaName(str, Enum):
    """An enum to represent schema filenames.

    Attributes:
        ATTRIBUTE: Property of an instance that can change while the category remains the same.
        CALIBRATED_SENSOR: Definition of a particular sensor as calibrated on a vehicle.
        CATEGORY: Object categories.
        EGO_POSE: Ego vehicle pose at at particular timestamp.
        INSTANCE: An object instance.
        LOG: Information about the log from which the data aws extracted.
        MAP: Map data that is stored as binary semantic masks from a top-down view.
        SAMPLE: A sample is an annotated keyframe at specific Hz.
        SAMPLE_ANNOTATION: A bounding box defining the position of an object seen in a sample.
        SAMPLE_DATA: A sensor data e.g. image, pointcloud or radar return.
        SCENE: A scene is a specific long sequence of consecutive frames extracted from a log.
        SENSOR: A specific sensor type.
        VISIBILITY: The visibility of instance is the fraction of annotation visible in all images.
        LIDARSEG (optional): The annotation of 3D point cloud segmentation.
        OBJECT_ANN (optional): The annotation of a foreground object in an image.
        SURFACE_ANN (optional): The annotation of a background object in an image.
        KEYPOINT (optional): The annotation of pose keypoints of an object in an image.
        VEHICLE_STATE (optional): The annotation of ego vehicle states.
    """

    ATTRIBUTE = "attribute"
    CALIBRATED_SENSOR = "calibrated_sensor"
    CATEGORY = "category"
    EGO_POSE = "ego_pose"
    INSTANCE = "instance"
    LOG = "log"
    MAP = "map"
    SAMPLE = "sample"
    SAMPLE_ANNOTATION = "sample_annotation"
    SAMPLE_DATA = "sample_data"
    VISIBILITY = "visibility"
    SENSOR = "sensor"
    SCENE = "scene"
    LIDARSEG = "lidarseg"  # optional
    OBJECT_ANN = "object_ann"  # optional
    SURFACE_ANN = "surface_ann"  # optional
    KEYPOINT = "keypoint"  # optional
    VEHICLE_STATE = "vehicle_state"  # optional

    @property
    def filename(self) -> str:
        """Return the annotation json filename.

        Returns:
            Annotation json filename.
        """
        return f"{self.value}.json"

    def is_optional(self) -> bool:
        """Indicates if this schema name is optional.

        Returns:
            Return True if this schema is optional.
        """
        return self in (
            SchemaName.LIDARSEG,
            SchemaName.OBJECT_ANN,
            SchemaName.SURFACE_ANN,
            SchemaName.KEYPOINT,
            SchemaName.VEHICLE_STATE,
        )

filename property

Return the annotation json filename.

Returns:

Type Description
str

Annotation json filename.

is_optional()

Indicates if this schema name is optional.

Returns:

Type Description
bool

Return True if this schema is optional.

Source code in t4_devkit/schema/name.py
def is_optional(self) -> bool:
    """Indicates if this schema name is optional.

    Returns:
        Return True if this schema is optional.
    """
    return self in (
        SchemaName.LIDARSEG,
        SchemaName.OBJECT_ANN,
        SchemaName.SURFACE_ANN,
        SchemaName.KEYPOINT,
        SchemaName.VEHICLE_STATE,
    )