raillabel_providerkit package

Subpackages

Submodules

raillabel_providerkit.exceptions module

Module contents

A library for annotation providers of raillabel-formatted data.

raillabel_providerkit.convert(data: dict, loader_class: type[LoaderABC] | None = None) Scene

Convert annotation data from provider formats into raillabel.

Parameters:
  • data (dict) – Raw data in the provider format, that should be converted.

  • loader_class (child-class of raillabel_providerkit.LoaderABC, optional) – Class used for converting the provider formatted data. If None is provided, then one is chosen based on criteria present in the data. Default is None.

Returns:

scene – Scene with the loaded data in the raillabel format.

Return type:

raillabel.Scene

Raises:

raillabel.UnsupportedFormatError – if the annotation file does not match any loaders.

raillabel_providerkit.validate(scene_source: dict | Path, ontology_source: dict | Path | None = None, validate_for_empty_frames: bool = True, validate_for_rail_side_order: bool = True, validate_for_missing_ego_track: bool = True, validate_for_sensors: bool = True, validate_for_uris: bool = True) list[Issue]

Validate a scene based on the Deutsche Bahn Requirements.

Args:

scene_source: The scene either as a dictionary or as a Path to the scene source file. ontology_source: The dataset ontology as a dictionary or as a Path to the ontology YAML

file. If not None, issues are returned if the scene contains annotations with invalid attributes or object types. Default is None.

validate_for_empty_frames (optional): If True, issues are returned if the scene contains

frames without annotations. Default is True.

validate_for_rail_side_order: If True, issues are returned if the scene contains track with

a mismatching rail side order. Default is True.

validate_for_missing_ego_track: If True, issues are returned if the scene contains frames

where the ego track (the track the recording train is driving on) is missing. Default is True.

validate_for_sensors: If True, issues are returned if the scene contains sensors that are

not supported or have the wrong sensor type.

validate_for_uris: If True, issues are returned if the uri fields in the scene contain

unsupported values.

Returns:

List of all requirement errors in the scene. If an empty list is returned, then there are no errors present and the scene is valid.