Skip to content

Commit 6f38f94

Browse files
authored
Merge pull request #35 from dbinfrago/feature/osdar26-ontology-and-validation-improvements
Feature/osdar26 ontology and validation improvements
2 parents 3d49193 + ccdf16d commit 6f38f94

159 files changed

Lines changed: 8634 additions & 259 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ instance/
7575
docs/_build/
7676
docs/source/code/
7777
docs/source/_build
78+
docs/build/
7879

7980
# PyBuilder
8081
.pybuilder/
@@ -166,3 +167,5 @@ cython_debug/
166167
# Project related
167168
playground/
168169
scripts/
170+
.github/instructions.md
171+
.instructions*

CHANGELOG.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<!--
2+
~ Copyright DB InfraGO AG and contributors
3+
~ SPDX-License-Identifier: Apache-2.0
4+
-->
5+
6+
# Changelog
7+
8+
All notable changes to this project will be documented in this file.
9+
10+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12+
13+
## [Unreleased]
14+
15+
### Added
16+
17+
#### Ontology Management
18+
- **Built-in Ontology Files**: Three pre-configured ontology files now bundled with the package
19+
- `osdar26`: Extended railway environment ontology with 25 object classes
20+
- `automatedtrain`: Safety-critical classes for automated train perception
21+
- `osdar23`: Original OSDAR23 dataset ontology
22+
- **New API Functions**:
23+
- `get_ontology_path(ontology_name)`: Retrieve path to built-in ontology files
24+
- `list_available_ontologies()`: List all available built-in ontologies
25+
- **Package Distribution**: Ontology files included in package via `MANIFEST.in`
26+
27+
#### GUI Application (NEW)
28+
- **PyQt6-based GUI** for users who prefer graphical interfaces over CLI
29+
- Easy folder selection for input scenes and output results
30+
- Built-in ontology dropdown (OSDAR26, AutomatedTrain, OSDAR23)
31+
- Custom ontology file browser support
32+
- Real-time progress tracking with visual progress bar
33+
- Multi-threaded validation (non-blocking UI)
34+
- Detailed status logging
35+
- **Installation**: `pip install raillabel-providerkit[gui]`
36+
- **Launch**: `python -m raillabel_providerkit.gui`
37+
- **Platform Support**: macOS, Windows, and Linux
38+
39+
#### OSDAR26 Ontology
40+
- **25 Object Classes** for comprehensive railway environment annotation:
41+
- Persons: `person`, `crowd`
42+
- Personal Mobility: `personal_item`, `pram`, `scooter`, `wheelchair`
43+
- Vehicles: `bicycle`, `group_of_bicycles`, `motorcycle`, `road_vehicle`
44+
- Animals: `animal`, `group_of_animals`
45+
- Railway Vehicles: `train`, `wagon`, `drag_shoe`
46+
- Track Infrastructure: `track`, `transition`, `switch`
47+
- Signaling: `signal`, `signal_pole`, `signal_bridge`, `catenary_pole`, `buffer_stop`
48+
- Hazards: `flame`, `smoke`
49+
- **Enhanced Signal Aspects**: 29 variants (Hp_0/1/2, Ks_1/2, Vr_0/1/2, Zs_2/2v/3/3v, Sh_0/1/2 in light/shape)
50+
- **Updated Occlusion Ranges**: 0-24%, 25-49%, 50-74%, 75-99%, 100%
51+
- **Extended Animal Species**: 17+ species including racoon, badger, swan, sheep, cow, horse, pig, fox, wolf, wildBoar, deer, stork, rabbit
52+
53+
#### AutomatedTrain Ontology
54+
- **Safety-Critical Classes** for automated train operation:
55+
- `obstacle`: Debris, rocks, trees, construction materials on track
56+
- `platform`: Platform detection and side identification
57+
- `level_crossing`: Crossing state monitoring (open, closing, closed, opening)
58+
- `speed_sign`: Speed limit detection with value attribute
59+
- **Enhanced Switch Tracking**: State attribute (straight, diverging)
60+
- **Emergency Detection**: `isEmergency` attribute for road_vehicle class
61+
- **Boolean Safety Indicators**: Critical safety flags throughout ontology
62+
63+
#### Documentation
64+
- **API Reference Documentation**: Comprehensive Sphinx documentation for new APIs
65+
- **GUI User Guide**: Complete GUI documentation with screenshots and troubleshooting
66+
- **Usage Examples**: Python and CLI examples for all new features
67+
- **How-To Guides**: Updated validation guides with ontology selection examples
68+
69+
#### Tests
70+
- **15 New Tests** for ontology manager functionality:
71+
- `test_ontologies.py`: Comprehensive test suite for `get_ontology_path()` and `list_available_ontologies()`
72+
- Content validation tests for all three ontologies
73+
- Integration tests with validation system
74+
- **All 380 Tests Passing** (365 existing + 15 new)
75+
76+
### Changed
77+
78+
#### License Migration
79+
- **BREAKING**: Migrated from Apache-2.0 to MIT License
80+
- More permissive for commercial and open-source use
81+
- Minimal restrictions on usage, modification, and distribution
82+
- **Dual Licensing**: Configuration files remain CC0-1.0 (public domain)
83+
- **Updated Headers**: All 89 Python files updated to MIT license
84+
- **Documentation**: LICENSE file and all SPDX headers updated
85+
86+
#### API Changes
87+
- **New Exports** in `raillabel_providerkit.__init__.py`:
88+
- `get_ontology_path`
89+
- `list_available_ontologies`
90+
- **Backward Compatible**: All existing APIs remain unchanged
91+
92+
#### Package Structure
93+
- **New Modules**:
94+
- `raillabel_providerkit/ontologies/`: Built-in ontology files
95+
- `raillabel_providerkit/ontologies/manager.py`: Ontology management API
96+
- `raillabel_providerkit/gui/`: GUI application module
97+
- **Distribution**: `MANIFEST.in` ensures ontology YAML files are included
98+
99+
#### Documentation
100+
- **README.md**:
101+
- Added GUI usage instructions
102+
- Enhanced ontology documentation with comparison table
103+
- Programmatic API examples
104+
- Dual-license information
105+
- **Sphinx Docs**:
106+
- New API reference page
107+
- GUI tutorial (How-To #3)
108+
- Updated validation guides
109+
110+
### Fixed
111+
- None in this release
112+
113+
### Deprecated
114+
- None in this release
115+
116+
### Removed
117+
- Apache-2.0 as primary license (replaced with MIT)
118+
119+
### Security
120+
- None in this release
121+
122+
## Installation & Migration
123+
124+
### New Installation
125+
126+
```bash
127+
# Base package
128+
pip install raillabel-providerkit
129+
130+
# With GUI support
131+
pip install raillabel-providerkit[gui]
132+
```
133+
134+
### Upgrading from Previous Version
135+
136+
```bash
137+
pip install --upgrade raillabel-providerkit
138+
139+
# Add GUI support
140+
pip install --upgrade raillabel-providerkit[gui]
141+
```
142+
143+
### Breaking Changes
144+
145+
1. **License Change**: The project is now licensed under MIT instead of Apache-2.0. If your project has specific license requirements, please review the new license terms.
146+
147+
2. **Python API Additions Only**: No breaking changes to existing APIs. All new functionality is additive.
148+
149+
## Usage Examples
150+
151+
### Using Built-in Ontologies (NEW)
152+
153+
```python
154+
from raillabel_providerkit import validate, get_ontology_path
155+
156+
# Old way (still works)
157+
issues = validate("scene.json", ontology="path/to/ontology.yaml")
158+
159+
# New way (recommended)
160+
ontology_path = get_ontology_path("osdar26")
161+
issues = validate("scene.json", ontology=ontology_path)
162+
```
163+
164+
### GUI Application (NEW)
165+
166+
```bash
167+
# Launch GUI
168+
python -m raillabel_providerkit.gui
169+
```
170+
171+
```python
172+
# Or from Python
173+
from raillabel_providerkit.gui import launch_gui
174+
launch_gui()
175+
```
176+
177+
### List Available Ontologies (NEW)
178+
179+
```python
180+
from raillabel_providerkit import list_available_ontologies
181+
182+
print(list_available_ontologies())
183+
# ['osdar26', 'automatedtrain', 'osdar23']
184+
```
185+
186+
## Contributors
187+
188+
- DB InfraGO AG and contributors
189+
190+
## License
191+
192+
Copyright DB InfraGO AG, licensed under MIT License.
193+
194+
See [LICENSE](LICENSE) for full text.

LICENSE

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
1-
Apache License
2-
Version 2.0, January 2004
3-
http://www.apache.org/licenses/
1+
MIT License
42

5-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
3+
Copyright (c) 2024-2026 DB InfraGO AG and contributors
64

7-
1. Definitions.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
================================================================================
24+
THIRD-PARTY LICENSE INFORMATION
25+
26+
This project includes code and documentation that may be licensed under
27+
Apache License 2.0. See individual files for their specific licenses.
28+
29+
The main raillabel-providerkit code is licensed under MIT.
30+
Configuration files and data are licensed under CC0-1.0 where applicable.
831

932
"License" shall mean the terms and conditions for use, reproduction,
1033
and distribution as defined by Sections 1 through 9 of this document.

LICENSES/MIT.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-2026 DB InfraGO AG and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include raillabel_providerkit/ontologies/*.yaml
2+
include raillabel_providerkit/ontologies/*.license
3+
recursive-include raillabel_providerkit/format *.json
4+
recursive-include raillabel_providerkit/format *.license

0 commit comments

Comments
 (0)