From e5856967392dafc63f9c361749602a7ba5264f12 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Mon, 2 Dec 2024 11:26:03 +0100 Subject: [PATCH 1/2] docs: adapt validate docs --- docs/source/howtos/2 Validating Scenes.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/howtos/2 Validating Scenes.rst b/docs/source/howtos/2 Validating Scenes.rst index d19868f..29b8418 100644 --- a/docs/source/howtos/2 Validating Scenes.rst +++ b/docs/source/howtos/2 Validating Scenes.rst @@ -17,12 +17,14 @@ For the validation you need 2 things: the scene and the project specific ontholo The onthology should be provided by your project partner. It is a .yaml-file listing all classes and their attributes. .. code-block:: python + import json + from pathlib import Path from raillabel_providerkit import validate - import raillabel - scene = raillabel.load("path/to/scene.json") + with Path("path/to/scene.json").open() as scene_file: + scene_dict = json.load(scene_file) - assert validate(scene, "path/to/onthology.yaml") == [] + assert validate(scene_dict) == [] 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. From 2adc73ce040bb9f62d72dc9dc6480796f2220d56 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Mon, 2 Dec 2024 11:50:38 +0100 Subject: [PATCH 2/2] docs: change order of howtos --- .../howtos/{2 Validating Scenes.rst => 1 Validating Scenes.rst} | 2 +- .../howtos/{1 Converting Files.rst => 2 Converting Files.rst} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename docs/source/howtos/{2 Validating Scenes.rst => 1 Validating Scenes.rst} (98%) rename docs/source/howtos/{1 Converting Files.rst => 2 Converting Files.rst} (98%) diff --git a/docs/source/howtos/2 Validating Scenes.rst b/docs/source/howtos/1 Validating Scenes.rst similarity index 98% rename from docs/source/howtos/2 Validating Scenes.rst rename to docs/source/howtos/1 Validating Scenes.rst index 29b8418..ede665d 100644 --- a/docs/source/howtos/2 Validating Scenes.rst +++ b/docs/source/howtos/1 Validating Scenes.rst @@ -3,7 +3,7 @@ SPDX-License-Identifier: Apache-2.0 =================== -2 Validating Scenes +1 Validating Scenes =================== Motivation diff --git a/docs/source/howtos/1 Converting Files.rst b/docs/source/howtos/2 Converting Files.rst similarity index 98% rename from docs/source/howtos/1 Converting Files.rst rename to docs/source/howtos/2 Converting Files.rst index b6f2bb8..754da75 100644 --- a/docs/source/howtos/1 Converting Files.rst +++ b/docs/source/howtos/2 Converting Files.rst @@ -3,7 +3,7 @@ SPDX-License-Identifier: Apache-2.0 ============================= -1 Converting Annotation Files +2 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.