raillabel_providerkit.validation package

Subpackages

Submodules

raillabel_providerkit.validation.issue module

class raillabel_providerkit.validation.issue.Issue(type: IssueType, reason: str, identifiers: IssueIdentifiers | list[str | int])

Bases: object

An error that was found inside the scene.

identifiers: IssueIdentifiers | list[str | int]
reason: str
type: IssueType
class raillabel_providerkit.validation.issue.IssueIdentifiers(annotation: UUID | None = None, frame: int | None = None, object: UUID | None = None, sensor: str | None = None)

Bases: object

Information for locating an issue.

annotation: UUID | None = None
frame: int | None = None
object: UUID | None = None
sensor: str | None = None
class raillabel_providerkit.validation.issue.IssueType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

General classification of the issue.

EMPTY_FRAMES = 'EmptyFramesIssue'
RAIL_SIDE = 'RailSide'
SCHEMA = 'SchemaIssue'

raillabel_providerkit.validation.validate module

raillabel_providerkit.validation.validate.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.

Module contents

Package for validating raillabel data regarding the format requirements.

class raillabel_providerkit.validation.Issue(type: IssueType, reason: str, identifiers: IssueIdentifiers | list[str | int])

Bases: object

An error that was found inside the scene.

identifiers: IssueIdentifiers | list[str | int]
reason: str
type: IssueType
class raillabel_providerkit.validation.IssueIdentifiers(annotation: UUID | None = None, frame: int | None = None, object: UUID | None = None, sensor: str | None = None)

Bases: object

Information for locating an issue.

annotation: UUID | None = None
frame: int | None = None
object: UUID | None = None
sensor: str | None = None
class raillabel_providerkit.validation.IssueType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

General classification of the issue.

EMPTY_FRAMES = 'EmptyFramesIssue'
RAIL_SIDE = 'RailSide'
SCHEMA = 'SchemaIssue'
raillabel_providerkit.validation.validate_empty_frames(scene: Scene) list[Issue]

Validate whether all frames of a scene have at least one annotation.

If an empty list is returned, then there are no errors present.

raillabel_providerkit.validation.validate_onthology(scene: Scene, onthology: dict | Path) list[str]

Validate a scene based on the classes and attributes.

Parameters:
  • scene (raillabel.Scene) – The scene containing the annotations.

  • onthology (dict or Path) – Onthology YAML-data or file containing a information about all classes and their attributes. The onthology must adhere to the onthology_schema. If a path is provided, the file is loaded as a YAML.

Returns:

list of all onthology errors in the scene. If an empty list is returned, then there are no errors present.

Return type:

list[str]

raillabel_providerkit.validation.validate_rail_side(scene: Scene) list[Issue]

Validate whether all tracks have <= one left and right rail, and that they have correct order.

Parameters:

scene (raillabel.Scene) – Scene, that should be validated.

Returns:

list of all rail side errors in the scene. If an empty list is returned, then there are no errors present.

Return type:

list[str]

raillabel_providerkit.validation.validate_schema(data: dict) list[Issue]

Validate a scene for adherence to the raillabel schema.