Harden SAM roof refinement geometry gates
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-30 04:00:24 +02:00
parent 5ac3238c27
commit 29378bba42
4 changed files with 74 additions and 6 deletions
+28
View File
@@ -3746,6 +3746,34 @@ Validation:
- `cd backend && python -m alembic heads && python -m alembic upgrade head --sql`
# Codex Execution Log
## 2026-07-30 - Fail-closed SAM roof-refinement gate hardening
### What changed
- Reproduced the V64 Flemish calibration-candidate export for Aarschot, Beveren and Oostkamp from the immutable temporal-cutoff manifest.
- Ran the checksummed `/app/sam2_t.pt` model on the server RTX 4080 SUPER and rendered deterministic before/after label contact sheets.
- Rejected both the legacy refinement settings and a stricter trial because dense or temporally absent footprint prompts still produced visually invalid roof boxes; neither result was promoted into a training corpus.
- Hardened `scripts/refine_yolo_labels_with_sam.py` with configurable centre-shift and per-dimension ratio gates. The selected values and model checksum are persisted in `sam-refinement.json`.
### What was tested
- `python -m pytest backend/tests/test_sam_roof_label_refinement.py -q` passed (`2 passed`).
- `python -m py_compile scripts/refine_yolo_labels_with_sam.py` passed.
- CUDA refinement completed on 706 candidate labels; the strictest trial refined 659 and retained 47 explicit fallbacks. Visual QA still failed, so the run remains evidence only.
### What remains open
- Replace or align the rejected Flemish calibration labels with image-visible, independently validated roof boxes.
- Rebuild and retrain only after that label gate passes; protected test and pure-background evaluation remain closed.
### Known limitations
- Geometry plausibility alone cannot prove that a SAM mask represents the intended roof in dense scenes.
### Next recommended pass
- Add an auditable image/footprint alignment stage or select lower-parallax independent Flemish AOIs, then repeat visual QA before corpus composition.
## Post-V1 national coverage completion: Wallonia (2026-07-22)
- Located and live-validated the stable official WALOUS 2018 GeoTIFF