audit YOLO geometry and overlapping validation rows
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from scripts.evaluate_yolo_checkpoint_matrix import dataset_overlap_evidence
|
||||
|
||||
|
||||
def test_dataset_overlap_evidence_marks_repeated_validation_rows(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
dataset_yaml = tmp_path / "dataset.yaml"
|
||||
dataset_yaml.write_text("path: .\nval: images/val\n", encoding="utf-8")
|
||||
(tmp_path / "yolo_tile_dataset_summary.json").write_text(
|
||||
json.dumps({"tile_size": 512, "stride": 256}), encoding="utf-8"
|
||||
)
|
||||
|
||||
evidence = dataset_overlap_evidence(dataset_yaml)
|
||||
|
||||
assert evidence["status"] == "overlapping"
|
||||
assert evidence["overlap_pixels"] == 256
|
||||
assert evidence["validation_rows_independent"] is False
|
||||
|
||||
|
||||
def test_dataset_overlap_evidence_is_explicit_when_summary_missing(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
evidence = dataset_overlap_evidence(tmp_path / "dataset.yaml")
|
||||
|
||||
assert evidence["status"] == "unavailable"
|
||||
assert evidence["validation_rows_independent"] is None
|
||||
Reference in New Issue
Block a user