raillabel.format.frame module

class raillabel.format.frame.Frame(timestamp: ~decimal.Decimal | None = None, sensors: dict[str, ~raillabel.format.sensor_reference.SensorReference] = <factory>, frame_data: dict[str, ~raillabel.format.num.Num] = <factory>, annotations: dict[~uuid.UUID, ~raillabel.format.bbox.Bbox | ~raillabel.format.cuboid.Cuboid | ~raillabel.format.poly2d.Poly2d | ~raillabel.format.poly3d.Poly3d | ~raillabel.format.seg3d.Seg3d] = <factory>)

Bases: object

A container of dynamic, timewise, information.

annotations: dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d]

All annotations of this frame.

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.

timestamp: Decimal | None = None

Timestamp containing the Unix epoch time of the frame with up to nanosecond precision.

to_json(objects: dict[UUID, Object]) JSONFrame

Export this object into the RailLabel JSON format.

raillabel.format.frame._annotations_from_json(json_object_data: dict[UUID, JSONObjectData] | None) dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d]
raillabel.format.frame._frame_data_from_dict(frame_properties: JSONFrameProperties | None) dict[str, Num]
raillabel.format.frame._objects_to_json(annotations: dict[UUID, Bbox | Cuboid | Poly2d | Poly3d | Seg3d], objects: dict[UUID, Object]) dict[str, JSONObjectData] | None
raillabel.format.frame._resolve_none_to_empty_list(optional_list: list | None) list
raillabel.format.frame._sensors_from_dict(frame_properties: JSONFrameProperties | None) dict[str, SensorReference]
raillabel.format.frame._timestamp_from_dict(frame_properties: JSONFrameProperties | None) Decimal | None