A devkit for working with recorded and annotated train ride data from Deutsche Bahn.
Project description
RailLabel
A devkit for working with recorded and annotated train ride data from Deutsche Bahn.
Documentation
Read the full documentation on Github pages.
Installation
You can install the latest released version directly from PyPI.
pip install raillabel
To set up a development environment, clone the project and install it into a virtual environment.
git clone https://github.com/DSD-DBS/raillabel
cd raillabel
python -m venv .venv
source .venv/bin/activate.sh # for Linux / Mac
.venv\Scripts\activate # for Windows
pip install -U pip pre-commit
pip install -e '.[docs,test]'
pre-commit install
Usage
The first step in using raillabel
is downloading a desired dataset (like OSDaR23). You can then load any scene by running
import raillabel
scene = raillabel.load("path/to/annotation_file.json")
This returns a raillabel.Scene
, which is the root class for the annotations.
If a file is too extensive for your use-case you can filter out certain parts of a scene like this
from raillabel.filter import (
IncludeObjectTypeFilter,
ExcludeAnnotationTypeFilter,
StartTimeFilter, ExcludeFrameIdFilter,
IncludeAttributesFilter
)
scene_with_only_trains = scene.filter([IncludeObjectTypeFilter(["rail_vehicle"])])
scene_without_bboxs = scene.filter([ExcludeAnnotationTypeFilter(["bbox"])])
cut_scene_with_only_red_trains = scene.filter([
StartTimeFilter("1587349200.004200000"),
ExcludeFrameIdFilter([2, 4]),
IncludeObjectTypeFilter(["rail_vehicle"]),
IncludeAttributesFilter({"color": "red"}),
])
An overview of all available filters can be found here.
If you then want to save your changes, then use
raillabel.save(cut_scene_with_only_red_trains, "/path/to/target.json")
Contributing
We'd love to see your bug reports and improvement suggestions! Please take a look at our guidelines for contributors for details.
Licenses
This project is compliant with the REUSE Specification Version 3.0.
Copyright DB InfraGO AG, licensed under Apache 2.0 (see full text in LICENSES/Apache-2.0.txt)
Dot-files are licensed under CC0-1.0 (see full text in LICENSES/CC0-1.0.txt)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file raillabel-4.0.0.tar.gz
.
File metadata
- Download URL: raillabel-4.0.0.tar.gz
- Upload date:
- Size: 69.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e6f57ade98e504ac6305423d9b5234264ff184ad7c11fb4d9f7dd50ae0bd1dd |
|
MD5 | 4ca223c2e826483b1244ed0abb7ebe3e |
|
BLAKE2b-256 | c8e5ba753fc6bf2f04d923a6c74f8af97bebc5139e61904aa88d25aff18650ed |
File details
Details for the file raillabel-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: raillabel-4.0.0-py3-none-any.whl
- Upload date:
- Size: 107.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f20301a5925c387d13865f01dd0bb23ebf2041847504fdd24488a8b64cd93130 |
|
MD5 | 7fb03ddb296ae5a82bc798ecae36e7c4 |
|
BLAKE2b-256 | c25abe62ef5b508a7283e7fcf9758c920a78d94988834fe6850c78aa862bc575 |