Record retained validation coverage
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user