Welcome to the documentation!

Python RailLabel Development-Kit

Black

Date: Dec 09, 2024 Version: 4.0.1.dev6+gce702f2

Description

This library is designed to assist in the handling of the sensor annotations of Deutsche Bahn in the OpenLABEL data format. Common usage for the library:

  • fetching specific information from annotation files

  • filtering for specific frames, annotations or objects

  • editing annotation files

Motivation

Working with our own data has brought up the need to interact with the annotations programmatically. The annotation data is stored in .json files in the ASAM OpenLABEL annotation format, an emerging industry standard targeted towards the automotive sector. But as a standard it is designed very inclusively, which makes it overloaded for our limited use cases. We therefore decided to create a submodel called “RailLabel” with a corresponding devkit for easier interaction with the data. The example below shows a comparison between a purely JSON based approach compared to the devkit.

With JSON only:

import json

with open('path/to/file.json', 'r') as data_file:
    scene = json.load(data_file)

scene['openlabel']['frames']['1']['frame_properties']['streams']['lidar']['stream_properties']['stream_sync']['timestamp'] += 37

with open('path/to/other_file.json', 'w') as data_file:
    json.dump(scene, data_file)

With RailLabel:

import raillabel

scene = raillabel.load('path/to/file.json')
scene.frames[1].sensors['lidar'].timestamp += 37
raillabel.save(scene, 'path/to/other_file.json')

Content