Skip to content

Commit bcd656f

Browse files
committed
feat: increase default horizon tolerance to 10%
1 parent 7938a87 commit bcd656f

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- **Configurable Tolerance Buffer**: Reduce false positives from horizon calculations
1919
- `horizon_tolerance_percent` parameter in `validate()` and `validate_horizon()`
2020
- CLI option: `--horizon-tolerance FLOAT` (percentage above horizon line)
21-
- **Default: 5.0%** - sensible default to account for typical calibration variations
21+
- **Default: 10.0%** - sensible default to account for typical calibration variations
2222
- Annotations within tolerance buffer are considered valid
23-
- Example: `--horizon-tolerance 10.0` accepts annotations up to 10% above calculated horizon
23+
- Example: `--horizon-tolerance 15.0` accepts annotations up to 15% above calculated horizon
2424
- **Applies only to track and transition annotations** - other object types are not checked
2525
- Useful when horizon calculations are slightly inaccurate due to calibration variations
2626

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ python -m raillabel_providerkit /path/to/folder_containing_scenes/ /path/to/outp
100100
For scenes where the horizon calculation might be slightly off due to calibration inaccuracies, you can add a tolerance buffer. This only applies to **track and transition** annotations:
101101

102102
```zsh
103-
# Add 5% tolerance above the calculated horizon line (default)
103+
# Use default 10% tolerance above the calculated horizon line
104104
python -m raillabel_providerkit validate /path/to/scenes/ /path/to/output/
105105

106106
# Or customize the tolerance
107-
python -m raillabel_providerkit validate /path/to/scenes/ /path/to/output/ --horizon-tolerance 10.0
107+
python -m raillabel_providerkit validate /path/to/scenes/ /path/to/output/ --horizon-tolerance 15.0
108108

109109
# With ontology validation
110110
python -m raillabel_providerkit validate /path/to/scenes/ /path/to/output/ --ontology config/parameters/osdar26.yaml --horizon-tolerance 10.0
111111
```
112112

113-
The tolerance is specified as a percentage. Annotations within this buffer zone above the horizon are considered valid. Default is 5.0% to account for typical calibration variations. This helps reduce false positives when horizon calculations are slightly inaccurate. **Note:** Horizon validation only checks track and transition annotations, not other object types.
113+
The tolerance is specified as a percentage. Annotations within this buffer zone above the horizon are considered valid. Default is 10.0% to account for typical calibration variations. This helps reduce false positives when horizon calculations are slightly inaccurate. **Note:** Horizon validation only checks track and transition annotations, not other object types.
114114

115115
## Exporting Scenes
116116

raillabel_providerkit/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ def cli() -> None:
272272
@click.option(
273273
"--horizon-tolerance",
274274
type=float,
275-
default=5.0,
275+
default=10.0,
276276
help=(
277-
"Tolerance buffer as percentage above horizon (e.g., 5.0 for 5%%). "
278-
"Only applies to track/transition annotations. Default is 5.0."
277+
"Tolerance buffer as percentage above horizon (e.g., 10.0 for 10%%). "
278+
"Only applies to track/transition annotations. Default is 10.0."
279279
),
280280
)
281281
@click.option("-q", "--quiet", is_flag=True, help="Disable progress bars")

raillabel_providerkit/validation/validate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def validate( # noqa: C901, PLR0912, PLR0913
4242
validate_for_horizon: bool = True,
4343
validate_for_annotation_type_per_sensor: bool = True,
4444
validate_for_transition: bool = True,
45-
horizon_tolerance_percent: float = 5.0,
45+
horizon_tolerance_percent: float = 10.0,
4646
) -> list[Issue]:
4747
"""Validate a scene based on the Deutsche Bahn Requirements.
4848
@@ -73,8 +73,8 @@ def validate( # noqa: C901, PLR0912, PLR0913
7373
validate_for_transition: If True, issues are returned if transition annotations have
7474
identical startTrack and endTrack values. Default is True.
7575
horizon_tolerance_percent: Tolerance buffer as percentage above the horizon line.
76-
Annotations within this buffer zone are considered valid. For example, 5.0 means
77-
annotations up to 5% above the horizon line are accepted. Default is 5.0 (5% buffer).
76+
Annotations within this buffer zone are considered valid. For example, 10.0 means
77+
annotations up to 10% above the horizon line are accepted. Default is 10.0 (10% buffer).
7878
This only affects track and transition annotations.
7979
8080

raillabel_providerkit/validation/validate_horizon/validate_horizon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _scene_uses_osdar26_calibration(scene: raillabel.Scene) -> bool:
5050

5151
def validate_horizon(
5252
scene: raillabel.Scene,
53-
horizon_tolerance_percent: float = 5.0,
53+
horizon_tolerance_percent: float = 10.0,
5454
) -> list[Issue]:
5555
"""Validate whether all track/transition annotations are below the horizon.
5656
@@ -67,8 +67,8 @@ def validate_horizon(
6767
Scene that should be validated.
6868
horizon_tolerance_percent : float, optional
6969
Tolerance buffer as percentage above the horizon line. Annotations within
70-
this buffer zone are considered valid. For example, 5.0 means annotations
71-
up to 5% above the horizon line are accepted. Default is 5.0 (5% buffer).
70+
this buffer zone are considered valid. For example, 10.0 means annotations
71+
up to 10% above the horizon line are accepted. Default is 10.0 (10% buffer).
7272
Helps reduce false positives from minor calibration inaccuracies.
7373
7474
Returns

0 commit comments

Comments
 (0)