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, validate_for_empty_frames: bool = True, validate_for_rail_side_order: 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. 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.

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.