derive cleaner min-4px YOLO corpus
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-08-09 19:51:17 +02:00
parent 736e773fb8
commit 2de438b9cc
9 changed files with 471 additions and 25 deletions
@@ -0,0 +1,21 @@
import pytest
from scripts.derive_yolo_min_dimension_corpus import filter_label_lines
def test_filter_label_lines_removes_only_rows_below_pixel_floor() -> None:
lines = [
"0 0.5 0.5 0.005 0.25",
"0 0.5 0.5 0.0078125 0.25",
"0 0.5 0.5 0.1 0.1",
]
kept, removed = filter_label_lines(lines, tile_size=512, min_dimension_pixels=4)
assert kept == lines[1:]
assert removed == [0]
def test_filter_label_lines_rejects_invalid_source_rows() -> None:
with pytest.raises(ValueError, match="invalid YOLO row"):
filter_label_lines(["0 0.5 0.5"], tile_size=512, min_dimension_pixels=4)