Skip to content

Commit 7fc5ab4

Browse files
authored
Merge pull request #30 from DSD-DBS/validate-howto
docs: extend validate howto documentation
2 parents 882d29e + 925c06b commit 7fc5ab4

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

docs/source/howtos/1 Validating Scenes.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,33 @@
88

99
Motivation
1010
##########
11-
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.
11+
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 you can create a PR).
1212

1313
Usage
1414
#####
1515

1616
.. code-block:: python
1717
18-
import json
1918
from pathlib import Path
2019
2120
from raillabel_providerkit import validate
2221
2322
scene_path = Path("path/to/scene.json")
24-
issues_in_scene = validate(scene_path)
23+
ontology_path = Path("path/to/ontology.yaml") # ontology file that should be provided by us
24+
issues_in_scene = validate(scene_path, ontology_path)
2525
assert issues_in_scene == []
2626
2727
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.
28+
29+
Under certain circumstances you might want to switch off certain validations. This should only be done if agreed upon with us. In this case, validate excepts use something like this
30+
31+
.. code-block:: python
32+
33+
from pathlib import Path
34+
35+
from raillabel_providerkit import validate
36+
37+
scene_path = Path("path/to/scene.json")
38+
issues_in_scene = validate(scene_path, validate_for_dimensions=False)
39+
40+
If you have not been provided with an ontology file, just leave the field empty. The scene is then not checked against ontology issues.

0 commit comments

Comments
 (0)