From 9f302d0b992146b3bf1986a7c60d85a38edd723b Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Fri, 20 Oct 2023 16:11:44 +0200 Subject: [PATCH 1/2] docs: fix false title --- docs/source/howtos/1 Converting Files.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/howtos/1 Converting Files.rst b/docs/source/howtos/1 Converting Files.rst index 3f76987..3d26d1d 100644 --- a/docs/source/howtos/1 Converting Files.rst +++ b/docs/source/howtos/1 Converting Files.rst @@ -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. From 88238618a469debdcdf603a8fb86ab5eb3971984 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Fri, 20 Oct 2023 16:12:06 +0200 Subject: [PATCH 2/2] docs: add docs for validation --- docs/source/howtos/2 Validating Scenes.rst | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/source/howtos/2 Validating Scenes.rst diff --git a/docs/source/howtos/2 Validating Scenes.rst b/docs/source/howtos/2 Validating Scenes.rst new file mode 100644 index 0000000..1340e9e --- /dev/null +++ b/docs/source/howtos/2 Validating Scenes.rst @@ -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.