Add detection quality matrix
This commit is contained in:
@@ -389,6 +389,26 @@ with detection count, score, precision, recall, F1, mean IoU and false
|
||||
positive/negative counts. It is intended to tune confidence/IoU/model choices,
|
||||
not to add new inference behavior.
|
||||
|
||||
To compare local model assets and tile settings as well as thresholds, run the
|
||||
quality matrix wrapper:
|
||||
|
||||
```bash
|
||||
REAL_RASTER_PATH=/mnt/user/appdata/geointel/storage/operator-data/geel_orthophoto_wms_512.tif \
|
||||
REAL_REFERENCE_VECTOR_PATH=/mnt/user/appdata/geointel/storage/operator-data/geel_grb_gbg_buildings.geojson \
|
||||
QUALITY_MODEL_ASSET_IDS="yolov8n-building-segmentation-pt yolov8n-pt" \
|
||||
QUALITY_TILE_SIZES="512 640" \
|
||||
QUALITY_TILE_OVERLAPS="64" \
|
||||
QUALITY_THRESHOLDS="0.50 0.15" \
|
||||
bash scripts/run_detection_quality_matrix.sh http://192.168.10.150:1202
|
||||
```
|
||||
|
||||
The matrix creates one real persisted workflow run per combination and writes
|
||||
`quality_matrix_summary.json` with the selected model asset, tile size, tile
|
||||
overlap, threshold, detection count, QA score, precision, recall, F1, mean IoU
|
||||
and false-positive/false-negative counts. It ranks `best_by_score`,
|
||||
`best_by_recall` and `best_by_precision`. It does not download weights, create
|
||||
fake detections, fetch live providers or change backend API behavior.
|
||||
|
||||
To inspect the evidence behind a calibration run, export the persisted QA
|
||||
evidence bundle:
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_detection_quality_matrix_compares_models_tiles_and_thresholds() -> None:
|
||||
script_path = ROOT / "scripts" / "run_detection_quality_matrix.sh"
|
||||
readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8")
|
||||
|
||||
assert script_path.exists()
|
||||
script = script_path.read_text(encoding="utf-8")
|
||||
|
||||
assert "bash -n scripts/run_detection_quality_matrix.sh" in readiness
|
||||
assert "verify_real_data_detection_qa_workflow.sh" in script
|
||||
assert "QUALITY_MODEL_ASSET_IDS" in script
|
||||
assert "QUALITY_TILE_SIZES" in script
|
||||
assert "QUALITY_TILE_OVERLAPS" in script
|
||||
assert "QUALITY_THRESHOLDS" in script
|
||||
assert "REAL_MODEL_ASSET_ID" in script
|
||||
assert "REAL_TILE_SIZE" in script
|
||||
assert "REAL_TILE_OVERLAP" in script
|
||||
assert "REAL_CONFIDENCE_THRESHOLD" in script
|
||||
assert "REAL_RASTER_PATH" in script
|
||||
assert "REAL_REFERENCE_VECTOR_PATH" in script
|
||||
assert "/api/v1/projects/${project_id}/quality-checks" in script
|
||||
assert "quality_matrix_summary.json" in script
|
||||
assert "best_by_score" in script
|
||||
assert "best_by_recall" in script
|
||||
assert "best_by_precision" in script
|
||||
assert "quality_score" in script
|
||||
assert "false_positives" in script
|
||||
assert "false_negatives" in script
|
||||
assert "demo/workflow" not in script
|
||||
assert "fixture_mode" not in script
|
||||
assert "will_download_models" not in script
|
||||
Reference in New Issue
Block a user