Fix YOLO class normalization
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-07 01:50:24 +02:00
parent 8f75c89b1c
commit 71c2cd9411
8 changed files with 98 additions and 14 deletions
+4 -2
View File
@@ -46,6 +46,7 @@ Sprint 8B adds an import-safe real YOLO adapter path:
- Real YOLO inference uses an existing raster tile manifest generated by the raster tile operation.
- YOLO raster tiles are normalized to RGB for inference when the tile artifact is not already a 3-band RGB image; the persisted georeferencing still comes from the tile manifest.
- YOLO pixel boxes are converted to EPSG:4326 detection polygons from tile transform or tile bounds metadata.
- YOLO class labels are normalized to lowercase for persisted detection records and filtering, while the original model label remains available in detection provenance.
- Detection runs remain synchronous behind the existing job and analysis-run persistence boundary for Sprint 8B.
### Sprint 13 YOLO operational preflight
@@ -162,8 +163,9 @@ The script verifies the full persisted chain:
It refuses to run without a real GeoTIFF-style raster and GeoJSON/JSON reference
vector. It does not seed demo data, use `fixture_mode`, fetch live providers or
download model weights. A zero detection count is valid as runtime evidence but
does not prove the model is useful for the target imagery.
download model weights. A zero detection count is valid as runtime evidence only
when the selected model genuinely returns no usable detections after canonical
class filtering; it does not prove the model is useful for the target imagery.
### Sprint 8C detection visualization and QA status
+24 -2
View File
@@ -1,3 +1,25 @@
## Sprint 123 YOLO class normalization and real-data inference fix (2026-07-07)
Changed:
- Investigated the Geel real-data smoke that persisted zero detections despite the configured building model being available.
- Confirmed on Tower that `/app/models/yolov8n-building-segmentation.pt` reports model class `Building` and returns 4 raw detections at confidence `0.5` on the same real Geel tile manifest.
- Fixed configured-YOLO detection persistence so model class names are compared case-insensitively against `class_filter`, persisted as canonical lowercase domain classes, and preserve the original model class name in `properties_json.model_class_name`.
- Added regression coverage in `backend/tests/test_sprint8b_yolo_foundation.py`.
Validation:
- RED: `python -m pytest backend/tests/test_sprint8b_yolo_foundation.py::test_yolo_class_filter_is_case_insensitive_and_persists_canonical_class -q` failed with `detection_count=0` because `Building` did not match `building`.
- `python -m pytest backend/tests/test_sprint8b_yolo_foundation.py::test_yolo_class_filter_is_case_insensitive_and_persists_canonical_class -q` passed.
- `python -m pytest backend/tests/test_sprint8b_yolo_foundation.py backend/tests/test_model_asset_catalog.py backend/tests/test_sprint121_real_data_detection_qa_smoke.py backend/tests/test_sprint122_raster_upload_metadata_mapping.py -q` passed: 20 tests.
Open:
- Full readiness, Tower deploy and repeated live real-data smoke still need to be run for this pass.
Limitations:
- This fixes class routing and persistence, not model quality. Thresholds, false positives and reference IoU quality still need calibration on larger local orthophoto samples.
Next recommended pass:
- Redeploy to Tower, rerun the Geel real-data smoke, then inspect persisted detections and QA metrics to choose practical confidence/IoU defaults.
## Sprint 122 Real operator data availability and raster metadata fix (2026-07-07)
Changed:
@@ -28,11 +50,11 @@ Validation:
- detection export: `0081c230-1766-4ff3-8df0-e47236f529d1`
Limitations:
- The workflow is now operational against real operator data, but the active evaluation model returned zero detections on the Geel sample AOI. This is model/data quality evidence, not a platform failure.
- The workflow is operational against real operator data. A follow-up class-normalization pass found that the active evaluation model returned `Building` while the workflow filtered on `building`; see Sprint 123.
- The prepared files are runtime artifacts on Tower, not repository fixtures.
Next recommended pass:
- Calibrate model selection and confidence/class handling against real Flemish orthophotos, or replace the evaluation model with a detector better aligned to aerial building footprints.
- Redeploy the class-normalization fix, rerun the real-data smoke and calibrate confidence/IoU thresholds against persisted detection and QA metrics.
## Sprint 121 Real data detection and QA workflow smoke (2026-07-07)
+2 -1
View File
@@ -93,7 +93,8 @@ This file now starts with the current implementation status. Older preparation/b
- [x] Add Export/System handoff hierarchy and provider registry density polish.
- [x] Add operator-provided real raster/reference detection + QA workflow smoke.
- [x] Validate the configured building model on a real georeferenced Kempen orthophoto/GeoTIFF with persisted reference vectors and QA/QC metrics.
- [ ] Calibrate or replace the evaluation building model after real orthophoto validation returned zero detections on the Geel sample AOI.
- [x] Fix configured-YOLO mixed-case class labels so `Building` model output matches `building` domain filters.
- [ ] Calibrate confidence, IoU and model selection against persisted Geel detections and additional local orthophoto/reference samples.
## Sprint 8 status