raillabel.json_format package¶
Submodules¶
raillabel.json_format.attributes module¶
- class raillabel.json_format.attributes.JSONAttributes(*, boolean: List[JSONBooleanAttribute] | None = None, num: List[JSONNumAttribute] | None = None, text: List[JSONTextAttribute] | None = None, vec: List[JSONVecAttribute] | None = None)¶
Bases:
_JSONFormatBase
Attributes is the alias of element data that can be nested inside geometric object data.
For example, a certain bounding box can have attributes related to its score, visibility, etc. These values can be nested inside the bounding box as attributes.
- boolean: list[JSONBooleanAttribute] | None¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- num: list[JSONNumAttribute] | None¶
- text: list[JSONTextAttribute] | None¶
- vec: list[JSONVecAttribute] | None¶
raillabel.json_format.bbox module¶
- class raillabel.json_format.bbox.JSONBbox(*, name: str, val: Tuple[float, float, float, float], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 2D bounding box is defined as a 4-dimensional vector [x, y, w, h].
[x, y] is the center of the bounding box and [w, h] represent the width (horizontal, x-coordinate dimension) and height (vertical, y-coordinate dimension), respectively.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.boolean_attribute module¶
- class raillabel.json_format.boolean_attribute.JSONBooleanAttribute(*, name: str, val: bool)¶
Bases:
_JSONFormatBase
A boolean attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.coordinate_system module¶
- class raillabel.json_format.coordinate_system.JSONCoordinateSystem(*, parent: Literal['base', ''], type: Literal['sensor', 'local'], pose_wrt_parent: JSONTransformData | None = None, children: List[str] | None = None)¶
Bases:
_JSONFormatBase
A 3D reference frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- parent: Literal['base', '']¶
This is the string UID of the parent coordinate system this coordinate system is referring to.
- pose_wrt_parent: JSONTransformData | None¶
The transformation with regards to the parent coordinate system.
- type: Literal['sensor', 'local']¶
This is a string that describes the type of the coordinate system, for example, ‘local’, ‘geo’).
raillabel.json_format.cuboid module¶
- class raillabel.json_format.cuboid.JSONCuboid(*, name: str, val: Tuple[float, float, float, float, float, float, float, float, float, float], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A cuboid or 3D bounding box.
It is defined by the position of its center, the rotation in 3D, and its dimensions.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
This is a string encoding the name of this object data. It is used as index inside the corresponding object data pointers.
- val: tuple[float, float, float, float, float, float, float, float, float, float]¶
List of values encoding the position, rotation and dimensions. It is (x, y, z, qx, qy, qz, qw, sx, sy, sz) where (x, y, z) encodes the position, (qx, qy, qz, qw) encodes the quaternion that encode the rotation, and (sx, sy, sz) are the dimensions of the cuboid in its object coordinate system
raillabel.json_format.element_data_pointer module¶
- class raillabel.json_format.element_data_pointer.JSONElementDataPointer(*, attribute_pointers: Dict[str, Literal['num', 'text', 'boolean', 'vec']], frame_intervals: List[JSONFrameInterval], type: Literal['bbox', 'num', 'poly2d', 'poly3d', 'cuboid', 'vec'])¶
Bases:
_JSONFormatBase
A pointer to element data of elements.
It is indexed by ‘name’, and containing information about the element data type, for example, bounding box, cuboid, and the frame intervals in which this element_data exists within an element. That means, these pointers can be used to explore element data dynamic information within the JSON content.
- attribute_pointers: dict[str, Literal['num', 'text', 'boolean', 'vec']]¶
This is a JSON object which contains pointers to the attributes of the element data pointed by this pointer. The attributes pointer keys shall be the ‘name’ of the attribute of the element data this pointer points to.
- frame_intervals: list[JSONFrameInterval]¶
List of frame intervals of the element data pointed by this pointer.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Literal['bbox', 'num', 'poly2d', 'poly3d', 'cuboid', 'vec']¶
Type of the element data pointed by this pointer.
raillabel.json_format.frame module¶
- class raillabel.json_format.frame.JSONFrame¶
Bases:
_JSONFormatBase
A frame is a container of dynamic, timewise, information.
- frame_properties: JSONFrameProperties | None¶
Container of frame information other than annotations.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- objects: dict[UUID, JSONObjectData] | None¶
This is a JSON object that contains dynamic information on RailLabel objects. Object keys are strings containing 32 bytes UUIDs. Object values contain an ‘object_data’ JSON object.
- class raillabel.json_format.frame.JSONFrameData(*, num: List[JSONNum] | None = None)¶
Bases:
_JSONFormatBase
Additional data to describe attributes of the frame (like GPS position).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.frame.JSONFrameProperties¶
Bases:
_JSONFormatBase
Container of frame information other than annotations.
- frame_data: JSONFrameData | None¶
Additional data to describe attributes of the frame (like GPS position).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- streams: dict[str, JSONStreamSync] | None¶
Stream timestamps for synchronization.
raillabel.json_format.frame_interval module¶
- class raillabel.json_format.frame_interval.JSONFrameInterval(*, frame_start: int, frame_end: int)¶
Bases:
_JSONFormatBase
A frame interval defines a starting and ending frame number as a closed interval.
That means the interval includes the limit frame numbers.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.metadata module¶
- class raillabel.json_format.metadata.JSONMetadata(*, schema_version: Literal['1.0.0'], name: str | None = None, subschema_version: str | None = None, exporter_version: str | None = None, file_version: str | None = None, tagged_file: str | None = None, annotator: str | None = None, comment: str | None = None, **extra_data: Any)¶
Bases:
BaseModel
Metadata about the annotation file itself.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- schema_version: Literal['1.0.0']¶
Version number of the OpenLABEL schema this annotation file follows.
raillabel.json_format.num module¶
- class raillabel.json_format.num.JSONNum(*, name: str, val: float, coordinate_system: str | None = None, uid: UUID | None = None)¶
Bases:
_JSONFormatBase
A number.
- coordinate_system: str | None¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.num_attribute module¶
- class raillabel.json_format.num_attribute.JSONNumAttribute(*, name: str, val: float)¶
Bases:
_JSONFormatBase
A number attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.object module¶
- class raillabel.json_format.object.JSONObject(*, name: str, type: str, frame_intervals: List[JSONFrameInterval] | None = None, object_data_pointers: Dict[str, JSONElementDataPointer] | None = None)¶
Bases:
_JSONFormatBase
An object is the main type of annotation element.
Object is designed to represent spatiotemporal entities, such as physical objects in the real world. Objects shall have a name and type. Objects may have static and dynamic data. Objects are the only type of elements that may have geometric data, such as bounding boxes, cuboids, polylines, images, etc.
- frame_intervals: list[JSONFrameInterval] | None¶
The array of frame intervals where this object exists or is defined.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- object_data_pointers: dict[str, JSONElementDataPointer] | None¶
raillabel.json_format.object_data module¶
- class raillabel.json_format.object_data.JSONAnnotations(*, bbox: List[JSONBbox] | None = None, cuboid: List[JSONCuboid] | None = None, poly2d: List[JSONPoly2d] | None = None, poly3d: List[JSONPoly3d] | None = None, vec: List[JSONVec] | None = None)¶
Bases:
_JSONFormatBase
Container of the annotations by type.
- cuboid: list[JSONCuboid] | None¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- poly2d: list[JSONPoly2d] | None¶
- poly3d: list[JSONPoly3d] | None¶
- class raillabel.json_format.object_data.JSONObjectData¶
Bases:
_JSONFormatBase
Container of annotations of an object in a frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- object_data: JSONAnnotations¶
raillabel.json_format.poly2d module¶
- class raillabel.json_format.poly2d.JSONPoly2d(*, name: str, val: List[float | str], closed: bool, mode: Literal['MODE_POLY2D_ABSOLUTE'], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 2D polyline defined as a sequence of 2D points.
- attributes: JSONAttributes | None¶
- closed: bool¶
A boolean that defines whether the polyline is closed or not. In case it is closed, it is assumed that the last point of the sequence is connected with the first one.
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- mode: Literal['MODE_POLY2D_ABSOLUTE']¶
Mode of the polyline describes how the points should be arranged in the images. MODE_POLY2D_ABSOLUTE means that any point defined by an x-value followed by a y-value is the absolute position.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.poly3d module¶
- class raillabel.json_format.poly3d.JSONPoly3d(*, name: str, val: List[float], closed: bool, coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 3D polyline defined as a sequence of 3D points.
- attributes: JSONAttributes | None¶
- closed: bool¶
A boolean that defines whether the polyline is closed or not. In case it is closed, it is assumed that the last point of the sequence is connected with the first one.
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.scene module¶
- class raillabel.json_format.scene.JSONScene¶
Bases:
_JSONFormatBase
Root RailLabel object.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- openlabel: JSONSceneContent¶
- class raillabel.json_format.scene.JSONSceneContent(*, metadata: JSONMetadata, coordinate_systems: Dict[str, JSONCoordinateSystem] | None = None, streams: Dict[str, JSONStreamCamera | JSONStreamOther | JSONStreamRadar] | None = None, objects: Dict[UUID, JSONObject] | None = None, frames: Dict[int, JSONFrame] | None = None, frame_intervals: List[JSONFrameInterval] | None = None)¶
Bases:
_JSONFormatBase
Container of all scene content.
- coordinate_systems: dict[str, JSONCoordinateSystem] | None¶
- frame_intervals: list[JSONFrameInterval] | None¶
- metadata: JSONMetadata¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- objects: dict[UUID, JSONObject] | None¶
- streams: dict[str, JSONStreamCamera | JSONStreamOther | JSONStreamRadar] | None¶
raillabel.json_format.stream_camera module¶
- class raillabel.json_format.stream_camera.JSONIntrinsicsPinhole(*, camera_matrix: Tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion_coeffs: Tuple[float, float, float, float, float], height_px: int, width_px: int)¶
Bases:
_JSONFormatBase
JSON object defining an instance of the intrinsic parameters of a pinhole camera.
- camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float]¶
This is a 3x4 camera matrix which projects 3D homogeneous points (4x1) from a camera coordinate system into the image plane (3x1). This is the usual K matrix for camera projection as in OpenCV. It is extended from 3x3 to 3x4 to enable its direct utilisation to project 4x1 homogeneous 3D points. The matrix is defined to follow the camera model: x-to-right, y-down, z-forward. The following equation applies: x_img = camera_matrix * X_ccs.
- distortion_coeffs: tuple[float, float, float, float, float]¶
This is the array 1x5 radial and tangential distortion coefficients.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.stream_camera.JSONStreamCamera¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object contains the intrinsics of a camera sensor.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamCameraProperties¶
Intrinsic calibration of the stream.
- type: Literal['camera']¶
A string encoding the type of the stream.
- class raillabel.json_format.stream_camera.JSONStreamCameraProperties¶
Bases:
_JSONFormatBase
Intrinsic calibration of the stream.
- intrinsics_pinhole: JSONIntrinsicsPinhole¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.stream_other module¶
- class raillabel.json_format.stream_other.JSONStreamOther(*, type: Literal['lidar', 'gps_imu', 'other'], uri: str | None = None, description: str | None = None)¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object describes a sensor without intrinsic calibration.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Literal['lidar', 'gps_imu', 'other']¶
A string encoding the type of the stream.
raillabel.json_format.stream_radar module¶
- class raillabel.json_format.stream_radar.JSONIntrinsicsRadar(*, resolution_px_per_m: float, height_px: int, width_px: int)¶
Bases:
_JSONFormatBase
JSON object defining an instance of the intrinsic parameters of a radar.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.stream_radar.JSONStreamRadar¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object contains the intrinsics of a radar sensor.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamRadarProperties¶
Intrinsic calibration of the stream.
- type: Literal['radar']¶
A string encoding the type of the stream.
- class raillabel.json_format.stream_radar.JSONStreamRadarProperties¶
Bases:
_JSONFormatBase
Intrinsic calibration of the stream.
- intrinsics_radar: JSONIntrinsicsRadar¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.stream_sync module¶
- class raillabel.json_format.stream_sync.JSONStreamSync¶
Bases:
_JSONFormatBase
Syncronization information of a stream in a frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamSyncProperties¶
- class raillabel.json_format.stream_sync.JSONStreamSyncProperties¶
Bases:
_JSONFormatBase
The sync information.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- sync: JSONStreamSyncTimestamp¶
- class raillabel.json_format.stream_sync.JSONStreamSyncTimestamp(*, timestamp: Decimal | str)¶
Bases:
_JSONFormatBase
The timestamp of a stream sync.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.text_attribute module¶
- class raillabel.json_format.text_attribute.JSONTextAttribute(*, name: str, val: str)¶
Bases:
_JSONFormatBase
A text attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.transform_data module¶
- class raillabel.json_format.transform_data.JSONTransformData(*, translation: Tuple[float, float, float], quaternion: Tuple[float, float, float, float])¶
Bases:
_JSONFormatBase
The translation and rotation of one coordinate system to another.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
raillabel.json_format.vec module¶
- class raillabel.json_format.vec.JSONVec(*, name: str, val: List[float], coordinate_system: str, uid: UUID | None = None, type: Literal['values', 'range'] | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A vector (list) of numbers.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
This is a string encoding the name of this object data. It is used as index inside the corresponding object data pointers.
raillabel.json_format.vec_attribute module¶
- class raillabel.json_format.vec_attribute.JSONVecAttribute(*, name: str, val: List[float | str])¶
Bases:
_JSONFormatBase
A vec attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Module contents¶
Package for classes representing the direct RailLabel JSON objects.
- class raillabel.json_format.JSONAnnotations(*, bbox: List[JSONBbox] | None = None, cuboid: List[JSONCuboid] | None = None, poly2d: List[JSONPoly2d] | None = None, poly3d: List[JSONPoly3d] | None = None, vec: List[JSONVec] | None = None)¶
Bases:
_JSONFormatBase
Container of the annotations by type.
- cuboid: list[JSONCuboid] | None¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- poly2d: list[JSONPoly2d] | None¶
- poly3d: list[JSONPoly3d] | None¶
- class raillabel.json_format.JSONAttributes(*, boolean: List[JSONBooleanAttribute] | None = None, num: List[JSONNumAttribute] | None = None, text: List[JSONTextAttribute] | None = None, vec: List[JSONVecAttribute] | None = None)¶
Bases:
_JSONFormatBase
Attributes is the alias of element data that can be nested inside geometric object data.
For example, a certain bounding box can have attributes related to its score, visibility, etc. These values can be nested inside the bounding box as attributes.
- boolean: list[JSONBooleanAttribute] | None¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- num: list[JSONNumAttribute] | None¶
- text: list[JSONTextAttribute] | None¶
- vec: list[JSONVecAttribute] | None¶
- class raillabel.json_format.JSONBbox(*, name: str, val: Tuple[float, float, float, float], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 2D bounding box is defined as a 4-dimensional vector [x, y, w, h].
[x, y] is the center of the bounding box and [w, h] represent the width (horizontal, x-coordinate dimension) and height (vertical, y-coordinate dimension), respectively.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONBooleanAttribute(*, name: str, val: bool)¶
Bases:
_JSONFormatBase
A boolean attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONCoordinateSystem(*, parent: Literal['base', ''], type: Literal['sensor', 'local'], pose_wrt_parent: JSONTransformData | None = None, children: List[str] | None = None)¶
Bases:
_JSONFormatBase
A 3D reference frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- parent: Literal['base', '']¶
This is the string UID of the parent coordinate system this coordinate system is referring to.
- pose_wrt_parent: JSONTransformData | None¶
The transformation with regards to the parent coordinate system.
- type: Literal['sensor', 'local']¶
This is a string that describes the type of the coordinate system, for example, ‘local’, ‘geo’).
- class raillabel.json_format.JSONCuboid(*, name: str, val: Tuple[float, float, float, float, float, float, float, float, float, float], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A cuboid or 3D bounding box.
It is defined by the position of its center, the rotation in 3D, and its dimensions.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
This is a string encoding the name of this object data. It is used as index inside the corresponding object data pointers.
- val: tuple[float, float, float, float, float, float, float, float, float, float]¶
List of values encoding the position, rotation and dimensions. It is (x, y, z, qx, qy, qz, qw, sx, sy, sz) where (x, y, z) encodes the position, (qx, qy, qz, qw) encodes the quaternion that encode the rotation, and (sx, sy, sz) are the dimensions of the cuboid in its object coordinate system
- class raillabel.json_format.JSONElementDataPointer(*, attribute_pointers: Dict[str, Literal['num', 'text', 'boolean', 'vec']], frame_intervals: List[JSONFrameInterval], type: Literal['bbox', 'num', 'poly2d', 'poly3d', 'cuboid', 'vec'])¶
Bases:
_JSONFormatBase
A pointer to element data of elements.
It is indexed by ‘name’, and containing information about the element data type, for example, bounding box, cuboid, and the frame intervals in which this element_data exists within an element. That means, these pointers can be used to explore element data dynamic information within the JSON content.
- attribute_pointers: dict[str, Literal['num', 'text', 'boolean', 'vec']]¶
This is a JSON object which contains pointers to the attributes of the element data pointed by this pointer. The attributes pointer keys shall be the ‘name’ of the attribute of the element data this pointer points to.
- frame_intervals: list[JSONFrameInterval]¶
List of frame intervals of the element data pointed by this pointer.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Literal['bbox', 'num', 'poly2d', 'poly3d', 'cuboid', 'vec']¶
Type of the element data pointed by this pointer.
- class raillabel.json_format.JSONFrame(*, frame_properties: JSONFrameProperties | None = None, objects: Dict[UUID, JSONObjectData] | None = None)¶
Bases:
_JSONFormatBase
A frame is a container of dynamic, timewise, information.
- frame_properties: JSONFrameProperties | None¶
Container of frame information other than annotations.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- objects: dict[UUID, JSONObjectData] | None¶
This is a JSON object that contains dynamic information on RailLabel objects. Object keys are strings containing 32 bytes UUIDs. Object values contain an ‘object_data’ JSON object.
- class raillabel.json_format.JSONFrameData(*, num: List[JSONNum] | None = None)¶
Bases:
_JSONFormatBase
Additional data to describe attributes of the frame (like GPS position).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONFrameInterval(*, frame_start: int, frame_end: int)¶
Bases:
_JSONFormatBase
A frame interval defines a starting and ending frame number as a closed interval.
That means the interval includes the limit frame numbers.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONFrameProperties(*, timestamp: Decimal | str | None = None, streams: Dict[str, JSONStreamSync] | None = None, frame_data: JSONFrameData | None = None)¶
Bases:
_JSONFormatBase
Container of frame information other than annotations.
- frame_data: JSONFrameData | None¶
Additional data to describe attributes of the frame (like GPS position).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- streams: dict[str, JSONStreamSync] | None¶
Stream timestamps for synchronization.
- class raillabel.json_format.JSONIntrinsicsPinhole(*, camera_matrix: Tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion_coeffs: Tuple[float, float, float, float, float], height_px: int, width_px: int)¶
Bases:
_JSONFormatBase
JSON object defining an instance of the intrinsic parameters of a pinhole camera.
- camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float]¶
This is a 3x4 camera matrix which projects 3D homogeneous points (4x1) from a camera coordinate system into the image plane (3x1). This is the usual K matrix for camera projection as in OpenCV. It is extended from 3x3 to 3x4 to enable its direct utilisation to project 4x1 homogeneous 3D points. The matrix is defined to follow the camera model: x-to-right, y-down, z-forward. The following equation applies: x_img = camera_matrix * X_ccs.
- distortion_coeffs: tuple[float, float, float, float, float]¶
This is the array 1x5 radial and tangential distortion coefficients.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONIntrinsicsRadar(*, resolution_px_per_m: float, height_px: int, width_px: int)¶
Bases:
_JSONFormatBase
JSON object defining an instance of the intrinsic parameters of a radar.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONMetadata(*, schema_version: Literal['1.0.0'], name: str | None = None, subschema_version: str | None = None, exporter_version: str | None = None, file_version: str | None = None, tagged_file: str | None = None, annotator: str | None = None, comment: str | None = None, **extra_data: Any)¶
Bases:
BaseModel
Metadata about the annotation file itself.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- schema_version: Literal['1.0.0']¶
Version number of the OpenLABEL schema this annotation file follows.
- class raillabel.json_format.JSONNum(*, name: str, val: float, coordinate_system: str | None = None, uid: UUID | None = None)¶
Bases:
_JSONFormatBase
A number.
- coordinate_system: str | None¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONNumAttribute(*, name: str, val: float)¶
Bases:
_JSONFormatBase
A number attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONObject(*, name: str, type: str, frame_intervals: List[JSONFrameInterval] | None = None, object_data_pointers: Dict[str, JSONElementDataPointer] | None = None)¶
Bases:
_JSONFormatBase
An object is the main type of annotation element.
Object is designed to represent spatiotemporal entities, such as physical objects in the real world. Objects shall have a name and type. Objects may have static and dynamic data. Objects are the only type of elements that may have geometric data, such as bounding boxes, cuboids, polylines, images, etc.
- frame_intervals: list[JSONFrameInterval] | None¶
The array of frame intervals where this object exists or is defined.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- object_data_pointers: dict[str, JSONElementDataPointer] | None¶
- class raillabel.json_format.JSONObjectData(*, object_data: JSONAnnotations)¶
Bases:
_JSONFormatBase
Container of annotations of an object in a frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- object_data: JSONAnnotations¶
- class raillabel.json_format.JSONPoly2d(*, name: str, val: List[float | str], closed: bool, mode: Literal['MODE_POLY2D_ABSOLUTE'], coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 2D polyline defined as a sequence of 2D points.
- attributes: JSONAttributes | None¶
- closed: bool¶
A boolean that defines whether the polyline is closed or not. In case it is closed, it is assumed that the last point of the sequence is connected with the first one.
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- mode: Literal['MODE_POLY2D_ABSOLUTE']¶
Mode of the polyline describes how the points should be arranged in the images. MODE_POLY2D_ABSOLUTE means that any point defined by an x-value followed by a y-value is the absolute position.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONPoly3d(*, name: str, val: List[float], closed: bool, coordinate_system: str, uid: UUID | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A 3D polyline defined as a sequence of 3D points.
- attributes: JSONAttributes | None¶
- closed: bool¶
A boolean that defines whether the polyline is closed or not. In case it is closed, it is assumed that the last point of the sequence is connected with the first one.
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONScene(*, openlabel: JSONSceneContent)¶
Bases:
_JSONFormatBase
Root RailLabel object.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- openlabel: JSONSceneContent¶
- class raillabel.json_format.JSONSceneContent(*, metadata: JSONMetadata, coordinate_systems: Dict[str, JSONCoordinateSystem] | None = None, streams: Dict[str, JSONStreamCamera | JSONStreamOther | JSONStreamRadar] | None = None, objects: Dict[UUID, JSONObject] | None = None, frames: Dict[int, JSONFrame] | None = None, frame_intervals: List[JSONFrameInterval] | None = None)¶
Bases:
_JSONFormatBase
Container of all scene content.
- coordinate_systems: dict[str, JSONCoordinateSystem] | None¶
- frame_intervals: list[JSONFrameInterval] | None¶
- metadata: JSONMetadata¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- objects: dict[UUID, JSONObject] | None¶
- streams: dict[str, JSONStreamCamera | JSONStreamOther | JSONStreamRadar] | None¶
- class raillabel.json_format.JSONStreamCamera(*, type: Literal['camera'], stream_properties: JSONStreamCameraProperties, uri: str | None = None, description: str | None = None)¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object contains the intrinsics of a camera sensor.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamCameraProperties¶
Intrinsic calibration of the stream.
- type: Literal['camera']¶
A string encoding the type of the stream.
- class raillabel.json_format.JSONStreamCameraProperties(*, intrinsics_pinhole: JSONIntrinsicsPinhole)¶
Bases:
_JSONFormatBase
Intrinsic calibration of the stream.
- intrinsics_pinhole: JSONIntrinsicsPinhole¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONStreamOther(*, type: Literal['lidar', 'gps_imu', 'other'], uri: str | None = None, description: str | None = None)¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object describes a sensor without intrinsic calibration.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Literal['lidar', 'gps_imu', 'other']¶
A string encoding the type of the stream.
- class raillabel.json_format.JSONStreamRadar(*, type: Literal['radar'], stream_properties: JSONStreamRadarProperties, uri: str | None = None, description: str | None = None)¶
Bases:
_JSONFormatBase
A stream describes the source of a data sequence, usually a sensor.
This specific object contains the intrinsics of a radar sensor.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamRadarProperties¶
Intrinsic calibration of the stream.
- type: Literal['radar']¶
A string encoding the type of the stream.
- class raillabel.json_format.JSONStreamRadarProperties(*, intrinsics_radar: JSONIntrinsicsRadar)¶
Bases:
_JSONFormatBase
Intrinsic calibration of the stream.
- intrinsics_radar: JSONIntrinsicsRadar¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONStreamSync(*, stream_properties: JSONStreamSyncProperties, uri: str | None = None)¶
Bases:
_JSONFormatBase
Syncronization information of a stream in a frame.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- stream_properties: JSONStreamSyncProperties¶
- class raillabel.json_format.JSONStreamSyncProperties(*, sync: JSONStreamSyncTimestamp)¶
Bases:
_JSONFormatBase
The sync information.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- sync: JSONStreamSyncTimestamp¶
- class raillabel.json_format.JSONStreamSyncTimestamp(*, timestamp: Decimal | str)¶
Bases:
_JSONFormatBase
The timestamp of a stream sync.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONTextAttribute(*, name: str, val: str)¶
Bases:
_JSONFormatBase
A text attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONTransformData(*, translation: Tuple[float, float, float], quaternion: Tuple[float, float, float, float])¶
Bases:
_JSONFormatBase
The translation and rotation of one coordinate system to another.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class raillabel.json_format.JSONVec(*, name: str, val: List[float], coordinate_system: str, uid: UUID | None = None, type: Literal['values', 'range'] | None = None, attributes: JSONAttributes | None = None)¶
Bases:
_JSONFormatBase
A vector (list) of numbers.
- attributes: JSONAttributes | None¶
- coordinate_system: str¶
Name of the coordinate system in respect of which this object data is expressed.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
This is a string encoding the name of this object data. It is used as index inside the corresponding object data pointers.
- class raillabel.json_format.JSONVecAttribute(*, name: str, val: List[float | str])¶
Bases:
_JSONFormatBase
A vec attribute.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].