Harden SAM roof refinement geometry gates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user