Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Docs #2

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/howtos/1 Converting Files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SPDX-License-Identifier: Apache-2.0

=============================
1 Validating Annotation Files
1 Converting 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.
Expand Down
28 changes: 28 additions & 0 deletions docs/source/howtos/2 Validating Scenes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
..
Copyright DB Netz AG and contributors
SPDX-License-Identifier: Apache-2.0

===================
2 Validating Scenes
===================

Motivation
##########
The validation of the project requirements should ideally be done as close to the source of the data as possible. This devkit therefore provides functionality to check for basic errors on the supplier side. If you are unsure whether your applications produce valid annotations, simply use the functions provided here to check. **Only send us data, if the methods below say that no errors are present.** If you find any bugs in the code, just hit us up and we will fix them as soon as possible or create a PR.

Usage
#####
For the validation you need 2 things: the scene and the project specific onthology.

The onthology should be provided by your project partner. It is a .yaml-file listing all classes and their attributes.

.. code-block:: python

from raillabel_providerkit import validate
import raillabel

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

assert validate(scene, "path/to/onthology.yaml") == []

If this code does not raise any errors, you are good to go. If it does, read the content of the list `validate` returns carefully. It should tell you where the errors are. If you are unsure, contact your project partner or raise an issue on GitHub.
Loading