fix: bound detection QA to inference coverage
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 00:35:39 +02:00
parent 2f9898bc82
commit 0cad8fdf76
12 changed files with 159 additions and 45 deletions
+8 -3
View File
@@ -548,9 +548,14 @@ Sprint 8C makes persisted detections reviewable:
- QA results reuse `quality_checks` and `metrics`; no parallel QA persistence system is introduced.
- Configured-YOLO QA derives its evaluation extent from the persisted tile
manifest. Tile bounds are transformed from their explicit source CRS to
EPSG:4326, unioned, and used to clip candidate/reference populations before
canonical footprint-IoU matching. Reference features wholly outside the
imagery presented to the model no longer count as false negatives.
EPSG:4326 and unioned. The union is first applied as a GiST-backed PostGIS
spatial predicate, then used to clip the bounded candidate/reference
populations before canonical footprint-IoU matching. Complete source counts
remain in QA evidence, but regional geometries outside inference coverage are
not materialized in application memory and do not count as false negatives.
- Canonical one-to-one IoU matching uses an in-memory spatial index only to
discard geometries whose envelopes cannot intersect. It does not change the
configured IoU threshold, greedy match ownership or persisted metrics.
- A separate reference-envelope IoU pass is persisted as
`box_to_footprint_diagnostics`. It quantifies possible matching artifacts from
comparing rectangular detections with irregular building footprints, but is
+5 -1
View File
@@ -893,7 +893,11 @@ Response persists a `quality_check` and `metrics` rows through the existing QA/Q
Configured-YOLO QA automatically reads `tile_manifest_path` from the persisted
`AnalysisRun.parameters_json`. Candidate and reference geometries are clipped
to the union of the manifest's tile bounds after explicit CRS transformation to
EPSG:4326. The response additionally returns:
EPSG:4326. Before reference geometries are materialized, the service applies
that coverage with an indexed PostGIS `ST_Intersects` predicate. The full
dataset count is retained separately so raw/evaluated/excluded counts remain
auditable without transferring a regional reference dataset to Python. The
response additionally returns:
- `candidate_feature_count_raw` and `reference_feature_count_raw`;
- `coverage`, including raw/evaluated/excluded/boundary-clipped population
+16
View File
@@ -8052,3 +8052,19 @@ Live operational proof:
Next:
- Reuse the bounded regional operator pattern for current roads, water and parcels, then add official population and land-use time series without changing Mol semantics or introducing interactive external fetching.
## Sprint 195 - Live guided detection and bounded regional QA (2026-07-14)
Implemented:
- Added one guided Detection Lab action that uploads a georeferenced raster through `DatasetService`, creates or reuses the canonical tile manifest, runs preflight, invokes the configured local YOLO adapter and opens persisted detection geometry on MapLibre.
- Live Tower validation used the official Mol orthophoto sample, produced nine 512 px tiles and persisted 1,953 detections in analysis run `3912e179-3d1d-4080-8093-f883bbe95d9c`.
- A real QA attempt against the 466,078-feature regional GRB building dataset revealed that coverage clipping happened after every reference row had already been materialized.
- Moved configured-YOLO reference bounding into the existing GiST-indexed PostGIS query with the persisted manifest coverage. Full source count, evaluated count and excluded count remain explicit in the persisted evidence.
- Added a Shapely STRtree candidate index around the unchanged exact IoU matcher and clarified the simple map legend/source whenever AI detections are active.
Validation before final deployment:
- Focused detection, coverage, QA and guided-workflow tests passed.
- Frontend TypeScript typecheck passed after the source/legend correction.
Next:
- Deploy the bounded QA correction, rerun the live persisted detection-versus-GRB comparison, verify persisted metrics and inspect the result in MapLibre before declaring the guided operational flow complete.