Add per-sample YOLO dataset audit diagnostics
This commit is contained in:
@@ -148,6 +148,20 @@ def test_operator_yolo_dataset_quality_audit_reports_dataset_risks(tmp_path: Pat
|
||||
assert report["label_stats"]["parsed_label_count"] == 3
|
||||
assert report["label_stats"]["invalid_label_count"] == 0
|
||||
assert report["min_label_visible_ratio"] == 0.25
|
||||
sample_by_slug = {sample["sample_slug"]: sample for sample in report["sample_summaries"]}
|
||||
assert sample_by_slug["geel"]["parsed_label_count"] == 2
|
||||
assert sample_by_slug["geel"]["invalid_label_count"] == 0
|
||||
assert sample_by_slug["geel"]["small_box_share"] == 0.5
|
||||
assert sample_by_slug["geel"]["median_box_area"] == 0.00505
|
||||
assert sample_by_slug["geel"]["quality_warnings"] == [
|
||||
"median_box_area_below_gate",
|
||||
"small_box_share_above_gate",
|
||||
]
|
||||
assert sample_by_slug["turnhout"]["parsed_label_count"] == 1
|
||||
assert sample_by_slug["turnhout"]["small_box_share"] == 0.0
|
||||
assert sample_by_slug["turnhout"]["quality_warnings"] == ["median_box_area_below_gate"]
|
||||
assert sample_by_slug["postel_bos"]["parsed_label_count"] == 0
|
||||
assert sample_by_slug["postel_bos"]["quality_warnings"] == []
|
||||
|
||||
warning_codes = {warning["code"] for warning in report["warnings"]}
|
||||
assert "positive_sample_count_below_gate" in warning_codes
|
||||
|
||||
Reference in New Issue
Block a user