raillabel


Nameraillabel JSON
Version 4.0.0 PyPI version JSON
download
home_pageNone
SummaryA devkit for working with recorded and annotated train ride data from Deutsche Bahn.
upload_time2024-11-18 12:15:00
maintainerNone
docs_urlNone
authorDB InfraGO AG
requires_python<3.14,>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
 ~ Copyright DB InfraGO AG and contributors
 ~ SPDX-License-Identifier: Apache-2.0
 -->

# RailLabel

<!-- prettier-ignore -->
![image](https://github.com/DSD-DBS/raillabel/actions/workflows/build-test-publish.yml/badge.svg)
![image](https://github.com/DSD-DBS/raillabel/actions/workflows/lint.yml/badge.svg)

A devkit for working with recorded and annotated train ride data from Deutsche Bahn.

# Documentation

<!-- prettier-ignore -->
Read the [full documentation on Github pages](https://dsd-dbs.github.io/raillabel).

# Installation

You can install the latest released version directly from PyPI.

```zsh
pip install raillabel
```

To set up a development environment, clone the project and install it into a
virtual environment.

```zsh
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](https://data.fid-move.de/dataset/osdar23)). You can then load any scene by running
```python
import raillabel

scene = raillabel.load("path/to/annotation_file.json")
```

This returns a [`raillabel.Scene`](https://dsd-dbs.github.io/raillabel/code/raillabel.html#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
```python
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](https://dsd-dbs.github.io/raillabel/code/raillabel.filter.html#module-raillabel.filter).

If you then want to save your changes, then use
```python
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](CONTRIBUTING.md) for details.

# Licenses

This project is compliant with the
[REUSE Specification Version 3.0](https://git.fsfe.org/reuse/docs/src/commit/d173a27231a36e1a2a3af07421f5e557ae0fec46/spec.md).

Copyright DB InfraGO AG, licensed under Apache 2.0 (see full text in
[LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt))

Dot-files are licensed under CC0-1.0 (see full text in
[LICENSES/CC0-1.0.txt](LICENSES/CC0-1.0.txt))

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "raillabel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "DB InfraGO AG",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c8/e5/ba753fc6bf2f04d923a6c74f8af97bebc5139e61904aa88d25aff18650ed/raillabel-4.0.0.tar.gz",
    "platform": "any",
    "description": "<!--\n ~ Copyright DB InfraGO AG and contributors\n ~ SPDX-License-Identifier: Apache-2.0\n -->\n\n# RailLabel\n\n<!-- prettier-ignore -->\n![image](https://github.com/DSD-DBS/raillabel/actions/workflows/build-test-publish.yml/badge.svg)\n![image](https://github.com/DSD-DBS/raillabel/actions/workflows/lint.yml/badge.svg)\n\nA devkit for working with recorded and annotated train ride data from Deutsche Bahn.\n\n# Documentation\n\n<!-- prettier-ignore -->\nRead the [full documentation on Github pages](https://dsd-dbs.github.io/raillabel).\n\n# Installation\n\nYou can install the latest released version directly from PyPI.\n\n```zsh\npip install raillabel\n```\n\nTo set up a development environment, clone the project and install it into a\nvirtual environment.\n\n```zsh\ngit clone https://github.com/DSD-DBS/raillabel\ncd raillabel\npython -m venv .venv\n\nsource .venv/bin/activate.sh  # for Linux / Mac\n.venv\\Scripts\\activate  # for Windows\n\npip install -U pip pre-commit\npip install -e '.[docs,test]'\npre-commit install\n```\n\n# Usage\n\nThe first step in using `raillabel` is downloading a desired dataset (like [OSDaR23](https://data.fid-move.de/dataset/osdar23)). You can then load any scene by running\n```python\nimport raillabel\n\nscene = raillabel.load(\"path/to/annotation_file.json\")\n```\n\nThis returns a [`raillabel.Scene`](https://dsd-dbs.github.io/raillabel/code/raillabel.html#raillabel.Scene), which is the root class for the annotations.\n\nIf a file is too extensive for your use-case you can filter out certain parts of a scene like this\n```python\nfrom raillabel.filter import (\n    IncludeObjectTypeFilter,\n    ExcludeAnnotationTypeFilter,\n    StartTimeFilter, ExcludeFrameIdFilter,\n    IncludeAttributesFilter\n)\n\nscene_with_only_trains = scene.filter([IncludeObjectTypeFilter([\"rail_vehicle\"])])\n\nscene_without_bboxs = scene.filter([ExcludeAnnotationTypeFilter([\"bbox\"])])\n\ncut_scene_with_only_red_trains = scene.filter([\n    StartTimeFilter(\"1587349200.004200000\"),\n    ExcludeFrameIdFilter([2, 4]),\n    IncludeObjectTypeFilter([\"rail_vehicle\"]),\n    IncludeAttributesFilter({\"color\": \"red\"}),\n])\n```\nAn overview of all available filters can be found [here](https://dsd-dbs.github.io/raillabel/code/raillabel.filter.html#module-raillabel.filter).\n\nIf you then want to save your changes, then use\n```python\nraillabel.save(cut_scene_with_only_red_trains, \"/path/to/target.json\")\n```\n\n# Contributing\n\nWe'd love to see your bug reports and improvement suggestions! Please take a\nlook at our [guidelines for contributors](CONTRIBUTING.md) for details.\n\n# Licenses\n\nThis project is compliant with the\n[REUSE Specification Version 3.0](https://git.fsfe.org/reuse/docs/src/commit/d173a27231a36e1a2a3af07421f5e557ae0fec46/spec.md).\n\nCopyright DB InfraGO AG, licensed under Apache 2.0 (see full text in\n[LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt))\n\nDot-files are licensed under CC0-1.0 (see full text in\n[LICENSES/CC0-1.0.txt](LICENSES/CC0-1.0.txt))\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A devkit for working with recorded and annotated train ride data from Deutsche Bahn.",
    "version": "4.0.0",
    "project_urls": {
        "Documentation": "https://dsd-dbs.github.io/raillabel",
        "Homepage": "https://github.com/DSD-DBS/raillabel"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c25abe62ef5b508a7283e7fcf9758c920a78d94988834fe6850c78aa862bc575",
                "md5": "7fb03ddb296ae5a82bc798ecae36e7c4",
                "sha256": "f20301a5925c387d13865f01dd0bb23ebf2041847504fdd24488a8b64cd93130"
            },
            "downloads": -1,
            "filename": "raillabel-4.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7fb03ddb296ae5a82bc798ecae36e7c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.8",
            "size": 107835,
            "upload_time": "2024-11-18T12:14:59",
            "upload_time_iso_8601": "2024-11-18T12:14:59.054779Z",
            "url": "https://files.pythonhosted.org/packages/c2/5a/be62ef5b508a7283e7fcf9758c920a78d94988834fe6850c78aa862bc575/raillabel-4.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8e5ba753fc6bf2f04d923a6c74f8af97bebc5139e61904aa88d25aff18650ed",
                "md5": "4ca223c2e826483b1244ed0abb7ebe3e",
                "sha256": "3e6f57ade98e504ac6305423d9b5234264ff184ad7c11fb4d9f7dd50ae0bd1dd"
            },
            "downloads": -1,
            "filename": "raillabel-4.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4ca223c2e826483b1244ed0abb7ebe3e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.8",
            "size": 69016,
            "upload_time": "2024-11-18T12:15:00",
            "upload_time_iso_8601": "2024-11-18T12:15:00.706776Z",
            "url": "https://files.pythonhosted.org/packages/c8/e5/ba753fc6bf2f04d923a6c74f8af97bebc5139e61904aa88d25aff18650ed/raillabel-4.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 12:15:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DSD-DBS",
    "github_project": "raillabel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "raillabel"
}
        
Elapsed time: 0.33650s