Record retained validation coverage
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-13 00:00:42 +02:00
parent 5b008668d7
commit d02b4e5219
5 changed files with 48 additions and 0 deletions
+3
View File
@@ -366,6 +366,9 @@ The tile exporter clips GRB building bounding boxes into each tile, writes
YOLO labels beside each tile image, keeps a deterministic ratio of empty
negative tiles, and records `yolo_tile_dataset_summary.json` with
`positive_tile_count`, `negative_tile_count` and skipped negative tile counts.
It separately records configured, retained and empty validation sample slugs;
this keeps a holdout that lost every tile to quality filtering visible without
pretending it contributed evaluation data.
`--min-label-visible-ratio` drops labels where only a small clipped fragment of
the original building bbox is visible inside the tile; this reduces noisy
tile-edge labels in overlapping-tile datasets. Use `0` for legacy behavior.
@@ -181,6 +181,21 @@ def validate_validation_split(samples: list[dict[str, Any]], val_slugs: set[str]
return val_slugs
def validation_sample_coverage(
tiles: list[dict[str, Any]],
val_slugs: set[str],
) -> dict[str, list[str]]:
retained = {
str(tile.get("sample_slug") or "").strip().lower()
for tile in tiles
if tile.get("kept", True) and str(tile.get("split") or "") == "val"
}
return {
"retained_validation_sample_slugs": sorted(retained),
"empty_validation_sample_slugs": sorted(val_slugs - retained),
}
def edge_starts(length: int, tile_size: int, stride: int) -> list[int]:
if tile_size <= 0:
raise ValueError("tile_size must be positive")
@@ -555,6 +570,7 @@ def main() -> int:
for tile in skipped_negative_tiles
if tile.get("skip_reason") == LOW_VARIANCE_NEGATIVE_SKIP_REASON
]
validation_coverage = validation_sample_coverage(kept_tiles, val_slugs)
summary = {
"status": "ok",
"dataset_yaml": str(dataset_yaml),
@@ -570,6 +586,7 @@ def main() -> int:
"blank_range_threshold": args.blank_range_threshold,
"source_sample_count": len(samples),
"validation_sample_slugs": sorted(val_slugs),
**validation_coverage,
"tile_count": len(kept_tiles),
"positive_tile_count": len(positive_tiles),
"negative_tile_count": len(negative_tiles),