Skip to content

Commit

Permalink
docs: add description for converting files
Browse files Browse the repository at this point in the history
  • Loading branch information
tklockau committed Oct 5, 2023
1 parent 02d5c4b commit 1330a65
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
37 changes: 37 additions & 0 deletions docs/source/howtos/1 Converting Files.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
..
Copyright DB Netz AG and contributors
SPDX-License-Identifier: Apache-2.0
=============================
1 Validating Annotation Files
=============================

Many annotation providers have their own proprietary format, that they use internally. If the project requirements demand the delivery of the data in the RailLabel format, then the `raillabel_providerkit.convert()` method can support you with that.

.. code-block:: python
from raillabel_providerkit import convert
import raillabel
import json # in the case the data is in the json-format
with open("path/to/source/data.json") as f:
raw_data = json.load(f)
raillabel_scene = convert(raw_data)
raillabel.save(raillabel_scene, "path/to/target/scene.json")
If you have created a proper loader class for your format in the loader_classes directory, your class should be selected automatically. If not, you should contact our engineers to create one.

In the case, that you do not want to publish your proprietary format, you can also keep your loader class local and provide it as a function parameter. Just make sure your loader class is a child of the `raillabel_providerkit.loader_classes.LoaderABC`-class.

.. code-block:: python
from raillabel_providerkit import convert
import raillabel
import json # in the case the data is in the json-format
with open("path/to/source/data.json") as f:
raw_data = json.load(f)
raillabel_scene = convert(raw_data, YourLoaderClass)
8 changes: 2 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Welcome to the documentation!
*****************************

Python RailLabel Development-Kit
Python RailLabel Provider-Kit
================================

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
Expand All @@ -17,11 +17,7 @@ Python RailLabel Development-Kit

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
This library is designed to assist annotation partners of DB in providing data, that meets our requirements.

If you want a quickstart at how to use this package, head right into the
:ref:`how-tos section <howtos>`.
Expand Down

0 comments on commit 1330a65

Please sign in to comment.