raillabel package

Subpackages

Module contents

Devkit for working with recorded and annotated train ride data from DB.

class raillabel.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.

classmethod from_json(json: JSONScene) Scene

Construct a scene from a json object.

metadata: Metadata

Container of information about the annotation file itself.

objects: dict[UUID, Object]

Unique objects (like a specific person) in this scene. Keys are object uuids

sensors: dict[str, Camera | Lidar | Radar | GpsImu | OtherSensor]

The sensors used in this scene. Keys are sensor names.

to_json() JSONScene

Export this scene into the RailLabel JSON format.

raillabel.load(path: Path | str) Scene

Load an annotation file as a scene.

raillabel.save(scene: Scene, path: Path | str, prettify_json: bool = False) None

Save a raillabel.Scene to a JSON file.