raillabel.format package¶
Submodules¶
raillabel.format.bbox module¶
- class raillabel.format.bbox.Bbox(pos: Point2d, size: Size2d, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
A 2D bounding box in an image.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONBbox, object_id: UUID) Bbox ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
raillabel.format.camera module¶
- class raillabel.format.camera.Camera(intrinsics: IntrinsicsPinhole, extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None, TYPE: str = 'camera')¶
Bases:
object
A camera sensor.
- extrinsics: Transform | None = None¶
External calibration of the sensor defined by the 3D transform to the coordinate system origin.
- classmethod from_json(json_stream: JSONStreamCamera, json_coordinate_system: JSONCoordinateSystem) Camera ¶
Construct an instant of this class from RailLabel JSON data.
- intrinsics: IntrinsicsPinhole¶
The intrinsic calibration of the sensor.
- to_json() tuple[JSONStreamCamera, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
raillabel.format.cuboid module¶
- class raillabel.format.cuboid.Cuboid(pos: Point3d, quat: Quaternion, size: Size3d, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
3D bounding box.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONCuboid, object_id: UUID) Cuboid ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- pos: Point3d¶
The center position of the cuboid in meters, where the x coordinate points ahead of the vehicle, y points to the left and z points upwards.
- quat: Quaternion¶
The rotation of the cuboid in quaternions.
- to_json(uid: UUID, object_type: str) JSONCuboid ¶
Export this object into the RailLabel JSON format.
raillabel.format.frame module¶
- class raillabel.format.frame.Frame(timestamp: Decimal | None = None, sensors: dict[str, SensorReference] = <factory>, frame_data: dict[str, Num] = <factory>, annotations: dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d] = <factory>)¶
Bases:
object
A container of dynamic, timewise, information.
- frame_data: dict[str, Num]¶
Dictionary containing data directly connected to the frame and not to any object, like gps/imu data. Dictionary keys are the ID-strings of the variable the data belongs to.
- classmethod from_json(json: JSONFrame) Frame ¶
Construct an instant of this class from RailLabel JSON data.
- sensors: dict[str, SensorReference]¶
References to the sensors with frame specific information like timestamp and uri.
raillabel.format.frame_interval module¶
- class raillabel.format.frame_interval.FrameInterval(start: int, end: int)¶
Bases:
object
Closed interval of frames.
- classmethod from_frame_ids(frame_ids: list[int]) list[FrameInterval] ¶
Convert a list of frame uids into FrameIntervals.
Example:¶
```python FrameInterval.from_frame_ids([0, 1, 2, 3, 9, 12, 13, 14]) == [
FrameInterval(0, 3), FrameInterval(9, 9), FrameInterval(12, 14),
]¶
- classmethod from_json(json: JSONFrameInterval) FrameInterval ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() JSONFrameInterval ¶
Export this object into the RailLabel JSON format.
raillabel.format.gps_imu module¶
- class raillabel.format.gps_imu.GpsImu(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A gps sensor with inertial measurement unit.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) GpsImu ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
raillabel.format.intrinsics_pinhole module¶
- class raillabel.format.intrinsics_pinhole.IntrinsicsPinhole(camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion: tuple[float, float, float, float, float], width_px: int, height_px: int)¶
Bases:
object
Intrinsic calibration for a camera sensor.
- 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: tuple[float, float, float, float, float]¶
This is the array 1x5 radial and tangential distortion coefficients.
- classmethod from_json(json: JSONIntrinsicsPinhole) IntrinsicsPinhole ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() JSONIntrinsicsPinhole ¶
Export this object into the RailLabel JSON format.
raillabel.format.intrinsics_radar module¶
- class raillabel.format.intrinsics_radar.IntrinsicsRadar(resolution_px_per_m: float, width_px: int, height_px: int)¶
Bases:
object
Intrinsic calibration for a radar sensor.
- classmethod from_json(json: JSONIntrinsicsRadar) IntrinsicsRadar ¶
Construct an instant of this class from RailLabel JSON data.
- resolution_px_per_m: float¶
Factor for calculating the 3D coordinates of a pixel in the cartesian radar images. Number of pixels in the images per meter from the sensor.
- to_json() JSONIntrinsicsRadar ¶
Export this object into the RailLabel JSON format.
raillabel.format.lidar module¶
- class raillabel.format.lidar.Lidar(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A lidar sensor.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) Lidar ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
raillabel.format.metadata module¶
- class raillabel.format.metadata.Metadata(schema_version: str, annotator: str | None = None, comment: str | None = None, exporter_version: str | None = None, file_version: str | None = None, name: str | None = None, subschema_version: str | None = None, tagged_file: str | None = None)¶
Bases:
object
Container for metadata information about the scene itself.
- classmethod from_json(json: JSONMetadata) Metadata ¶
Construct an instant of this class from RailLabel JSON data.
- subschema_version: str | None = None¶
Version number of the RailLabel schema this annotation object follows.
- to_json() JSONMetadata ¶
Export this object into the RailLabel JSON format.
raillabel.format.num module¶
raillabel.format.object module¶
- class raillabel.format.object.Object(name: str, type: str)¶
Bases:
object
Physical, unique object in the data, that can be tracked via its UID.
- classmethod from_json(json: JSONObject) Object ¶
Construct an instant of this class from RailLabel JSON data.
- name: str¶
Name of the object. It is a friendly name and not used for indexing. Commonly the class name is used followed by an underscore and an integer (i.e. person_0032).
- to_json(object_id: UUID, frames: dict[int, Frame]) JSONObject ¶
Export this object into the RailLabel JSON format.
raillabel.format.other_sensor module¶
- class raillabel.format.other_sensor.OtherSensor(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A sensor that is not represented by the available options.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) OtherSensor ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
raillabel.format.point2d module¶
raillabel.format.point3d module¶
raillabel.format.poly2d module¶
- class raillabel.format.poly2d.Poly2d(points: list[Point2d], closed: bool, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
Sequence of 2D points. Can either be a polygon or polyline.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONPoly2d, object_id: UUID) Poly2d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- to_json(uid: UUID, object_type: str) JSONPoly2d ¶
Export this object into the RailLabel JSON format.
raillabel.format.poly3d module¶
- class raillabel.format.poly3d.Poly3d(points: list[Point3d], closed: bool, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
Sequence of 3D points. Can either be a polygon or polyline.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONPoly3d, object_id: UUID) Poly3d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- to_json(uid: UUID, object_type: str) JSONPoly3d ¶
Export this object into the RailLabel JSON format.
raillabel.format.quaternion module¶
raillabel.format.radar module¶
- class raillabel.format.radar.Radar(intrinsics: IntrinsicsRadar, extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None, TYPE: str = 'radar')¶
Bases:
object
A radar sensor.
- extrinsics: Transform | None = None¶
External calibration of the sensor defined by the 3D transform to the coordinate system origin.
- classmethod from_json(json_stream: JSONStreamRadar, json_coordinate_system: JSONCoordinateSystem) Radar ¶
Construct an instant of this class from RailLabel JSON data.
- intrinsics: IntrinsicsRadar¶
The intrinsic calibration of the sensor.
- to_json() tuple[JSONStreamRadar, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
raillabel.format.scene module¶
- class raillabel.format.scene.Scene(metadata: Metadata, sensors: dict[str, Camera | Lidar | Radar | GpsImu | OtherSensor] = <factory>, objects: dict[UUID, Object] = <factory>, frames: dict[int, Frame] = <factory>)¶
Bases:
object
The root RailLabel class, which contains all data.
- filter(filters: list[_FilterAbc]) Scene ¶
Return a scene with annotations, sensors, objects and frames excluded.
- frames: dict[int, Frame]¶
A container of dynamic, timewise, information. Keys are the frame integer number.
- objects: dict[UUID, Object]¶
Unique objects (like a specific person) in this scene. Keys are object uuids
raillabel.format.seg3d module¶
- class raillabel.format.seg3d.Seg3d(point_ids: list[int], object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
The 3D segmentation of a lidar pointcloud.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONVec, object_id: UUID) Seg3d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
raillabel.format.sensor_reference module¶
- class raillabel.format.sensor_reference.SensorReference(timestamp: Decimal, uri: str | None = None)¶
Bases:
object
A reference to a sensor in a specific frame.
- classmethod from_json(json: JSONStreamSync) SensorReference ¶
Construct an instant of this class from RailLabel JSON data.
- timestamp: Decimal¶
Timestamp containing the Unix epoch time of the sensor in a specific frame with up to nanosecond precision.
- to_json() JSONStreamSync ¶
Export this object into the RailLabel JSON format.
raillabel.format.size2d module¶
raillabel.format.size3d module¶
raillabel.format.transform module¶
- class raillabel.format.transform.Transform(pos: Point3d, quat: Quaternion)¶
Bases:
object
A transformation between two coordinate systems.
- classmethod from_json(json: JSONTransformData) Transform ¶
Construct an instant of this class from RailLabel JSON data.
- quat: Quaternion¶
Rotation quaternion with regards to the parent coordinate system.
- to_json() JSONTransformData ¶
Export this object into the RailLabel JSON format.
Module contents¶
Module containing all relevant format classes.
- class raillabel.format.Bbox(pos: Point2d, size: Size2d, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
A 2D bounding box in an image.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONBbox, object_id: UUID) Bbox ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- class raillabel.format.Camera(intrinsics: IntrinsicsPinhole, extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None, TYPE: str = 'camera')¶
Bases:
object
A camera sensor.
- extrinsics: Transform | None = None¶
External calibration of the sensor defined by the 3D transform to the coordinate system origin.
- classmethod from_json(json_stream: JSONStreamCamera, json_coordinate_system: JSONCoordinateSystem) Camera ¶
Construct an instant of this class from RailLabel JSON data.
- intrinsics: IntrinsicsPinhole¶
The intrinsic calibration of the sensor.
- to_json() tuple[JSONStreamCamera, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Cuboid(pos: Point3d, quat: Quaternion, size: Size3d, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
3D bounding box.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONCuboid, object_id: UUID) Cuboid ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- pos: Point3d¶
The center position of the cuboid in meters, where the x coordinate points ahead of the vehicle, y points to the left and z points upwards.
- quat: Quaternion¶
The rotation of the cuboid in quaternions.
- to_json(uid: UUID, object_type: str) JSONCuboid ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Frame(timestamp: Decimal | None = None, sensors: dict[str, SensorReference] = <factory>, frame_data: dict[str, Num] = <factory>, annotations: dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d] = <factory>)¶
Bases:
object
A container of dynamic, timewise, information.
- frame_data: dict[str, Num]¶
Dictionary containing data directly connected to the frame and not to any object, like gps/imu data. Dictionary keys are the ID-strings of the variable the data belongs to.
- classmethod from_json(json: JSONFrame) Frame ¶
Construct an instant of this class from RailLabel JSON data.
- sensors: dict[str, SensorReference]¶
References to the sensors with frame specific information like timestamp and uri.
- class raillabel.format.FrameInterval(start: int, end: int)¶
Bases:
object
Closed interval of frames.
- classmethod from_frame_ids(frame_ids: list[int]) list[FrameInterval] ¶
Convert a list of frame uids into FrameIntervals.
Example:¶
```python FrameInterval.from_frame_ids([0, 1, 2, 3, 9, 12, 13, 14]) == [
FrameInterval(0, 3), FrameInterval(9, 9), FrameInterval(12, 14),
]¶
- classmethod from_json(json: JSONFrameInterval) FrameInterval ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() JSONFrameInterval ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.GpsImu(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A gps sensor with inertial measurement unit.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) GpsImu ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.IntrinsicsPinhole(camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion: tuple[float, float, float, float, float], width_px: int, height_px: int)¶
Bases:
object
Intrinsic calibration for a camera sensor.
- 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: tuple[float, float, float, float, float]¶
This is the array 1x5 radial and tangential distortion coefficients.
- classmethod from_json(json: JSONIntrinsicsPinhole) IntrinsicsPinhole ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() JSONIntrinsicsPinhole ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.IntrinsicsRadar(resolution_px_per_m: float, width_px: int, height_px: int)¶
Bases:
object
Intrinsic calibration for a radar sensor.
- classmethod from_json(json: JSONIntrinsicsRadar) IntrinsicsRadar ¶
Construct an instant of this class from RailLabel JSON data.
- resolution_px_per_m: float¶
Factor for calculating the 3D coordinates of a pixel in the cartesian radar images. Number of pixels in the images per meter from the sensor.
- to_json() JSONIntrinsicsRadar ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Lidar(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A lidar sensor.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) Lidar ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Metadata(schema_version: str, annotator: str | None = None, comment: str | None = None, exporter_version: str | None = None, file_version: str | None = None, name: str | None = None, subschema_version: str | None = None, tagged_file: str | None = None)¶
Bases:
object
Container for metadata information about the scene itself.
- classmethod from_json(json: JSONMetadata) Metadata ¶
Construct an instant of this class from RailLabel JSON data.
- subschema_version: str | None = None¶
Version number of the RailLabel schema this annotation object follows.
- to_json() JSONMetadata ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Num(name: str, val: float, id: UUID | None = None, sensor_id: str | None = None)¶
Bases:
object
A number.
- class raillabel.format.Object(name: str, type: str)¶
Bases:
object
Physical, unique object in the data, that can be tracked via its UID.
- classmethod from_json(json: JSONObject) Object ¶
Construct an instant of this class from RailLabel JSON data.
- name: str¶
Name of the object. It is a friendly name and not used for indexing. Commonly the class name is used followed by an underscore and an integer (i.e. person_0032).
- to_json(object_id: UUID, frames: dict[int, Frame]) JSONObject ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.OtherSensor(extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None)¶
Bases:
_SensorWithoutIntrinsics
A sensor that is not represented by the available options.
- classmethod from_json(json_stream: JSONStreamOther, json_coordinate_system: JSONCoordinateSystem) OtherSensor ¶
Construct an instant of this class from RailLabel JSON data.
- to_json() tuple[JSONStreamOther, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Point2d(x: float, y: float)¶
Bases:
object
A 2d point in an image.
- class raillabel.format.Point3d(x: float, y: float, z: float)¶
Bases:
object
A point in the 3D space.
- class raillabel.format.Poly2d(points: list[Point2d], closed: bool, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
Sequence of 2D points. Can either be a polygon or polyline.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONPoly2d, object_id: UUID) Poly2d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- to_json(uid: UUID, object_type: str) JSONPoly2d ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Poly3d(points: list[Point3d], closed: bool, object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
Sequence of 3D points. Can either be a polygon or polyline.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONPoly3d, object_id: UUID) Poly3d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- to_json(uid: UUID, object_type: str) JSONPoly3d ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Quaternion(x: float, y: float, z: float, w: float)¶
Bases:
object
A rotation represented by a quaternion.
- class raillabel.format.Radar(intrinsics: IntrinsicsRadar, extrinsics: Transform | None = None, uri: str | None = None, description: str | None = None, TYPE: str = 'radar')¶
Bases:
object
A radar sensor.
- extrinsics: Transform | None = None¶
External calibration of the sensor defined by the 3D transform to the coordinate system origin.
- classmethod from_json(json_stream: JSONStreamRadar, json_coordinate_system: JSONCoordinateSystem) Radar ¶
Construct an instant of this class from RailLabel JSON data.
- intrinsics: IntrinsicsRadar¶
The intrinsic calibration of the sensor.
- to_json() tuple[JSONStreamRadar, JSONCoordinateSystem] ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Scene(metadata: Metadata, sensors: dict[str, Camera | Lidar | Radar | GpsImu | OtherSensor] = <factory>, objects: dict[UUID, Object] = <factory>, frames: dict[int, Frame] = <factory>)¶
Bases:
object
The root RailLabel class, which contains all data.
- filter(filters: list[_FilterAbc]) Scene ¶
Return a scene with annotations, sensors, objects and frames excluded.
- frames: dict[int, Frame]¶
A container of dynamic, timewise, information. Keys are the frame integer number.
- objects: dict[UUID, Object]¶
Unique objects (like a specific person) in this scene. Keys are object uuids
- class raillabel.format.Seg3d(point_ids: list[int], object_id: UUID, sensor_id: str, attributes: dict[str, float | bool | str | list])¶
Bases:
object
The 3D segmentation of a lidar pointcloud.
- attributes: dict[str, float | bool | str | list]¶
Additional information associated with the annotation.
- classmethod from_json(json: JSONVec, object_id: UUID) Seg3d ¶
Construct an instant of this class from RailLabel JSON data.
- name(object_type: str) str ¶
Return the name of the annotation used for indexing in the object data pointers.
- object_id: UUID¶
The unique identifyer of the real-life object, this annotation belongs to.
- class raillabel.format.SensorReference(timestamp: Decimal, uri: str | None = None)¶
Bases:
object
A reference to a sensor in a specific frame.
- classmethod from_json(json: JSONStreamSync) SensorReference ¶
Construct an instant of this class from RailLabel JSON data.
- timestamp: Decimal¶
Timestamp containing the Unix epoch time of the sensor in a specific frame with up to nanosecond precision.
- to_json() JSONStreamSync ¶
Export this object into the RailLabel JSON format.
- class raillabel.format.Size2d(x: float, y: float)¶
Bases:
object
The size of a rectangle in a 2d image.
- class raillabel.format.Size3d(x: float, y: float, z: float)¶
Bases:
object
The 3D size of a cube.
- class raillabel.format.Transform(pos: Point3d, quat: Quaternion)¶
Bases:
object
A transformation between two coordinate systems.
- classmethod from_json(json: JSONTransformData) Transform ¶
Construct an instant of this class from RailLabel JSON data.
- quat: Quaternion¶
Rotation quaternion with regards to the parent coordinate system.
- to_json() JSONTransformData ¶
Export this object into the RailLabel JSON format.