raillabel_providerkit.format.understand_ai package¶
Submodules¶
raillabel_providerkit.format.understand_ai.bounding_box_2d module¶
- class raillabel_providerkit.format.understand_ai.bounding_box_2d.BoundingBox2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, x_min: float, y_min: float, x_max: float, y_max: float)¶
Bases:
_Annotation
A 2d bounding box.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
x_min (float) – Left corner of the bounding box in pixels.
y_min (float) – Top corner of the bounding box in pixels.
x_max (float) – Right corner of the bounding box in pixels.
y_max (float) – Bottom corner of the bounding box in pixels.
- OPENLABEL_ID = 'bbox'¶
- classmethod fromdict(data_dict: dict) BoundingBox2d ¶
Generate a BoundingBox2d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 2d bounding box.
- Return type:
raillabel_providerkit.format.understand_ai.bounding_box_3d module¶
- class raillabel_providerkit.format.understand_ai.bounding_box_3d.BoundingBox3d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, center: Point3d, size: Size3d, quaternion: Quaternion)¶
Bases:
_Annotation
A 3d bounding box.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
center (raillabel.format.understand_ai.Point3d) – Center position of the bounding box.
size (raillabel.format.understand_ai.Size3d) – 3d size of the bounding box.
quaternion (raillabel.format.understand_ai.Quaternion) – Rotation quaternion of the bounding box.
- OPENLABEL_ID = 'cuboid'¶
- classmethod fromdict(data_dict: dict) BoundingBox3d ¶
Generate a BoundingBox3d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 3d bounding box.
- Return type:
- quaternion: Quaternion¶
raillabel_providerkit.format.understand_ai.coordinate_system module¶
- class raillabel_providerkit.format.understand_ai.coordinate_system.CoordinateSystem(uid: str, topic: str, frame_id: str, position: list[float], rotation_quaternion: list[float], rotation_matrix: list[float], angle_axis_rotation: list[float], homogeneous_transform: list[float] | None = None, measured_position: list[float] | None = None, camera_matrix: list[float] | None = None, dist_coeffs: list[float] | None = None)¶
Bases:
object
Global information for a sensor regarding calibration.
- Parameters:
uid (str) – Friendly name of the sensor as well as its identifier. Must be unique
topic (str) – Rostopic of the sensor.
frame_id (str) – Name of the directory containing the files from this sensor.
position (list of float) – 3D translation with regards to the origin.
rotation_quaternion (list of float) – Rotation quaternion with regards to the origin.
rotation_matrix (list of float) – Rotation matrix with regards to the origin.
angle_axis_rotation (list of float) – Angle axis rotation with regards to the origin.
homogeneous_transform (list of float, optional) – Homogeneous transformation matrix with regards to the origin. Default is None.
camera_matrix (list of float, optional) – Camera matrix of the sensor. Only applies to sensors of type camera. Default is None.
dist_coeffs (list of float, optional) – Distortion coefficients of the sensor. Only applies to sensors of type camera. Default is None.
- classmethod fromdict(data_dict: dict) CoordinateSystem ¶
Generate a CoordinateSystem from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data.
- Returns:
coordinate_system – Converted coordinate_system.
- Return type:
raillabel_providerkit.format.understand_ai.frame module¶
- class raillabel_providerkit.format.understand_ai.frame.Frame(id: int, timestamp: Decimal, bounding_box_2ds: dict[str, BoundingBox2d], bounding_box_3ds: dict[str, BoundingBox3d], polygon_2ds: dict[str, Polygon2d], polyline_2ds: dict[str, Polyline2d], segmentation_3ds: dict[str, Segmentation3d], _annotation_uids: set[str] = None)¶
Bases:
object
A container of dynamic, timewise, information.
- Parameters:
id (int) – Numerical identifier of the frame. Must be unique within the scene.
timestamp (decimal.Decimal) – Timestamp containing the Unix epoch time of the frame with up to nanosecond precision.
annotations (dict) – Dictionary containing all annotations. The keys are the uids of the annotations and the values are objects of type BoundingBox2d, BoundingBox3d, Polygon2d, Polyline2d or Segementation3d.
- bounding_box_2ds: dict[str, BoundingBox2d]¶
- bounding_box_3ds: dict[str, BoundingBox3d]¶
- polyline_2ds: dict[str, Polyline2d]¶
- segmentation_3ds: dict[str, Segmentation3d]¶
raillabel_providerkit.format.understand_ai.metadata module¶
- class raillabel_providerkit.format.understand_ai.metadata.Metadata(clip_id: str, external_clip_id: str, project_id: str, export_time: str, exporter_version: str, coordinate_system_3d: str, coordinate_system_reference: str, folder_name: str)¶
Bases:
object
Container for metadata information about the scene itself.
- Parameters:
clip_id (str) – Identifier of the scene for internal purposes.
external_clip_id (str) – Identifier of the scene for external purposes.
project_id (str) – Identifier of the annotation project.
export_time (str) – Timestamp of the export in the format ‘YYYY-MM-DD hh:mm UTC’.
exporter_version (str) – Version of the Understand.AI-exporter.
coordinate_system_3d (str)
coordinate_system_reference (str)
folder_name (str) – Directory with the exported reference data (e.g. images, point clouds).
raillabel_providerkit.format.understand_ai.point_3d module¶
raillabel_providerkit.format.understand_ai.polygon_2d module¶
- class raillabel_providerkit.format.understand_ai.polygon_2d.Polygon2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, points: list[tuple[float, float]])¶
Bases:
_Annotation
A 2d polygon.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
points (list[tuple[float, float]]) – 2d points belonging to the polygon.
- OPENLABEL_ID = 'poly2d'¶
- classmethod fromdict(data_dict: dict) Polygon2d ¶
Generate a Polygon2d from a dictionary in the UAI format.
- to_raillabel() tuple[dict, str, str, dict] ¶
Convert to a raillabel compatible dict.
- Returns:
annotation (dict) – Dictionary valid for the raillabel schema.
object_id (str) – Friendly identifier of the object this sensor belongs to.
class_name (str) – Friendly identifier of the class the annotated object belongs to.
sensor_reference (dict) – Dictionary of the sensor reference.
raillabel_providerkit.format.understand_ai.polyline_2d module¶
- class raillabel_providerkit.format.understand_ai.polyline_2d.Polyline2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, points: list[tuple[float, float]])¶
Bases:
_Annotation
A 2d polyline.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
points (list[tuple[float, float]]) – 2d points belonging to the polyline.
- OPENLABEL_ID = 'poly2d'¶
- classmethod fromdict(data_dict: dict) Polyline2d ¶
Generate a Polyline2d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 2d polyline.
- Return type:
- to_raillabel() tuple[dict, str, str, dict] ¶
Convert to a raillabel compatible dict.
- Returns:
annotation (dict) – Dictionary valid for the raillabel schema.
object_id (str) – Friendly identifier of the object this sensor belongs to.
class_name (str) – Friendly identifier of the class the annotated object belongs to.
sensor_reference (dict) – Dictionary of the sensor reference.
raillabel_providerkit.format.understand_ai.quaternion module¶
- class raillabel_providerkit.format.understand_ai.quaternion.Quaternion(x: float, y: float, z: float, w: float)¶
Bases:
object
Dimensional information of an object in 3d.
- Parameters:
- classmethod fromdict(data_dict: dict) Quaternion ¶
Generate a Quaternion from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted quaternion.
- Return type:
raillabel_providerkit.format.understand_ai.scene module¶
- class raillabel_providerkit.format.understand_ai.scene.Scene(metadata: Metadata, coordinate_systems: dict[str, CoordinateSystem], frames: dict[int, Frame])¶
Bases:
object
The root Understand.Ai class, which contains all data.
- Parameters:
- coordinate_systems: dict[str, CoordinateSystem]¶
raillabel_providerkit.format.understand_ai.segmentation_3d module¶
- class raillabel_providerkit.format.understand_ai.segmentation_3d.Segmentation3d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, associated_points: list[int], number_of_points: int)¶
Bases:
_Annotation
The 3D segmentation of a lidar pointcloud.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
associated_points (list[int]) – List of point indices of the lidar pointcloud.
number_of_points (int) – Total number of points in the associated_points.
- OPENLABEL_ID = 'vec'¶
- classmethod fromdict(data_dict: dict) Segmentation3d ¶
Generate a Segmentation3d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 3d segmentation.
- Return type:
raillabel_providerkit.format.understand_ai.sensor_reference module¶
- class raillabel_providerkit.format.understand_ai.sensor_reference.SensorReference(type: str, uri: str, timestamp: Decimal)¶
Bases:
object
Information for a sensor in a frame.
- Parameters:
type (str) – Friendly name of the sensor and its unique identifier.
uri (str) – URI to the file containing the frame specific sensor output from the project directory.
timestamp (decimal.Decimal) – Unix timestamp of the sensor recording.
- classmethod fromdict(data_dict: dict) SensorReference ¶
Generate a SensorReference from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted sensor reference.
- Return type:
raillabel_providerkit.format.understand_ai.size_3d module¶
Module contents¶
Module containing all relevant understand.ai format classes.
- class raillabel_providerkit.format.understand_ai.BoundingBox2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, x_min: float, y_min: float, x_max: float, y_max: float)¶
Bases:
_Annotation
A 2d bounding box.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
x_min (float) – Left corner of the bounding box in pixels.
y_min (float) – Top corner of the bounding box in pixels.
x_max (float) – Right corner of the bounding box in pixels.
y_max (float) – Bottom corner of the bounding box in pixels.
- OPENLABEL_ID = 'bbox'¶
- classmethod fromdict(data_dict: dict) BoundingBox2d ¶
Generate a BoundingBox2d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 2d bounding box.
- Return type:
- sensor: SensorReference¶
- class raillabel_providerkit.format.understand_ai.BoundingBox3d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, center: Point3d, size: Size3d, quaternion: Quaternion)¶
Bases:
_Annotation
A 3d bounding box.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
center (raillabel.format.understand_ai.Point3d) – Center position of the bounding box.
size (raillabel.format.understand_ai.Size3d) – 3d size of the bounding box.
quaternion (raillabel.format.understand_ai.Quaternion) – Rotation quaternion of the bounding box.
- OPENLABEL_ID = 'cuboid'¶
- classmethod fromdict(data_dict: dict) BoundingBox3d ¶
Generate a BoundingBox3d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 3d bounding box.
- Return type:
- quaternion: Quaternion¶
- sensor: SensorReference¶
- class raillabel_providerkit.format.understand_ai.CoordinateSystem(uid: str, topic: str, frame_id: str, position: list[float], rotation_quaternion: list[float], rotation_matrix: list[float], angle_axis_rotation: list[float], homogeneous_transform: list[float] | None = None, measured_position: list[float] | None = None, camera_matrix: list[float] | None = None, dist_coeffs: list[float] | None = None)¶
Bases:
object
Global information for a sensor regarding calibration.
- Parameters:
uid (str) – Friendly name of the sensor as well as its identifier. Must be unique
topic (str) – Rostopic of the sensor.
frame_id (str) – Name of the directory containing the files from this sensor.
position (list of float) – 3D translation with regards to the origin.
rotation_quaternion (list of float) – Rotation quaternion with regards to the origin.
rotation_matrix (list of float) – Rotation matrix with regards to the origin.
angle_axis_rotation (list of float) – Angle axis rotation with regards to the origin.
homogeneous_transform (list of float, optional) – Homogeneous transformation matrix with regards to the origin. Default is None.
camera_matrix (list of float, optional) – Camera matrix of the sensor. Only applies to sensors of type camera. Default is None.
dist_coeffs (list of float, optional) – Distortion coefficients of the sensor. Only applies to sensors of type camera. Default is None.
- classmethod fromdict(data_dict: dict) CoordinateSystem ¶
Generate a CoordinateSystem from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data.
- Returns:
coordinate_system – Converted coordinate_system.
- Return type:
- class raillabel_providerkit.format.understand_ai.Frame(id: int, timestamp: Decimal, bounding_box_2ds: dict[str, BoundingBox2d], bounding_box_3ds: dict[str, BoundingBox3d], polygon_2ds: dict[str, Polygon2d], polyline_2ds: dict[str, Polyline2d], segmentation_3ds: dict[str, Segmentation3d], _annotation_uids: set[str] = None)¶
Bases:
object
A container of dynamic, timewise, information.
- Parameters:
id (int) – Numerical identifier of the frame. Must be unique within the scene.
timestamp (decimal.Decimal) – Timestamp containing the Unix epoch time of the frame with up to nanosecond precision.
annotations (dict) – Dictionary containing all annotations. The keys are the uids of the annotations and the values are objects of type BoundingBox2d, BoundingBox3d, Polygon2d, Polyline2d or Segementation3d.
- bounding_box_2ds: dict[str, BoundingBox2d]¶
- bounding_box_3ds: dict[str, BoundingBox3d]¶
- polyline_2ds: dict[str, Polyline2d]¶
- segmentation_3ds: dict[str, Segmentation3d]¶
- class raillabel_providerkit.format.understand_ai.Metadata(clip_id: str, external_clip_id: str, project_id: str, export_time: str, exporter_version: str, coordinate_system_3d: str, coordinate_system_reference: str, folder_name: str)¶
Bases:
object
Container for metadata information about the scene itself.
- Parameters:
clip_id (str) – Identifier of the scene for internal purposes.
external_clip_id (str) – Identifier of the scene for external purposes.
project_id (str) – Identifier of the annotation project.
export_time (str) – Timestamp of the export in the format ‘YYYY-MM-DD hh:mm UTC’.
exporter_version (str) – Version of the Understand.AI-exporter.
coordinate_system_3d (str)
coordinate_system_reference (str)
folder_name (str) – Directory with the exported reference data (e.g. images, point clouds).
- class raillabel_providerkit.format.understand_ai.Point3d(x: float, y: float, z: float)¶
Bases:
object
Dimensional information of an object in 3d.
- Parameters:
- class raillabel_providerkit.format.understand_ai.Polygon2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, points: list[tuple[float, float]])¶
Bases:
_Annotation
A 2d polygon.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
points (list[tuple[float, float]]) – 2d points belonging to the polygon.
- OPENLABEL_ID = 'poly2d'¶
- classmethod fromdict(data_dict: dict) Polygon2d ¶
Generate a Polygon2d from a dictionary in the UAI format.
- sensor: SensorReference¶
- to_raillabel() tuple[dict, str, str, dict] ¶
Convert to a raillabel compatible dict.
- Returns:
annotation (dict) – Dictionary valid for the raillabel schema.
object_id (str) – Friendly identifier of the object this sensor belongs to.
class_name (str) – Friendly identifier of the class the annotated object belongs to.
sensor_reference (dict) – Dictionary of the sensor reference.
- class raillabel_providerkit.format.understand_ai.Polyline2d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, points: list[tuple[float, float]])¶
Bases:
_Annotation
A 2d polyline.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
points (list[tuple[float, float]]) – 2d points belonging to the polyline.
- OPENLABEL_ID = 'poly2d'¶
- classmethod fromdict(data_dict: dict) Polyline2d ¶
Generate a Polyline2d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 2d polyline.
- Return type:
- sensor: SensorReference¶
- to_raillabel() tuple[dict, str, str, dict] ¶
Convert to a raillabel compatible dict.
- Returns:
annotation (dict) – Dictionary valid for the raillabel schema.
object_id (str) – Friendly identifier of the object this sensor belongs to.
class_name (str) – Friendly identifier of the class the annotated object belongs to.
sensor_reference (dict) – Dictionary of the sensor reference.
- class raillabel_providerkit.format.understand_ai.Quaternion(x: float, y: float, z: float, w: float)¶
Bases:
object
Dimensional information of an object in 3d.
- Parameters:
- classmethod fromdict(data_dict: dict) Quaternion ¶
Generate a Quaternion from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted quaternion.
- Return type:
- class raillabel_providerkit.format.understand_ai.Scene(metadata: Metadata, coordinate_systems: dict[str, CoordinateSystem], frames: dict[int, Frame])¶
Bases:
object
The root Understand.Ai class, which contains all data.
- Parameters:
- coordinate_systems: dict[str, CoordinateSystem]¶
- class raillabel_providerkit.format.understand_ai.Segmentation3d(id: UUID, object_id: UUID, class_name: str, attributes: dict, sensor: SensorReference, associated_points: list[int], number_of_points: int)¶
Bases:
_Annotation
The 3D segmentation of a lidar pointcloud.
- Parameters:
id (uuid.UUID) – Unique identifier of the annotation.
object_id (uuid.UUID) – Unique identifier of the object this annotation refers to. Used for tracking.
class_name (str) – Name of the class this annotation belongs to.
attributes (dict[str, str or list]) – Key value pairs of attributes with the keys beeing the friendly identifier of the attribute and the value beeing the attribute value.
sensor (raillabel.format.understand_ai.SensorReference) – Information about the sensor this annotation is labeled in.
associated_points (list[int]) – List of point indices of the lidar pointcloud.
number_of_points (int) – Total number of points in the associated_points.
- OPENLABEL_ID = 'vec'¶
- classmethod fromdict(data_dict: dict) Segmentation3d ¶
Generate a Segmentation3d from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted 3d segmentation.
- Return type:
- sensor: SensorReference¶
- class raillabel_providerkit.format.understand_ai.SensorReference(type: str, uri: str, timestamp: Decimal)¶
Bases:
object
Information for a sensor in a frame.
- Parameters:
type (str) – Friendly name of the sensor and its unique identifier.
uri (str) – URI to the file containing the frame specific sensor output from the project directory.
timestamp (decimal.Decimal) – Unix timestamp of the sensor recording.
- classmethod fromdict(data_dict: dict) SensorReference ¶
Generate a SensorReference from a dictionary in the UAI format.
- Parameters:
data_dict (dict) – Understand.AI T4 format dictionary containing the data_dict.
- Returns:
Converted sensor reference.
- Return type: