Add persisted false-positive visual review gate
This commit is contained in:
@@ -194,6 +194,7 @@ class QualityEvidenceService:
|
||||
"iou": evidence.get("iou"),
|
||||
}
|
||||
)
|
||||
properties.update(QualityEvidenceService._row_provenance(row))
|
||||
|
||||
return {
|
||||
"type": "Feature",
|
||||
@@ -201,3 +202,29 @@ class QualityEvidenceService:
|
||||
"geometry": mapping(geometry),
|
||||
"properties": properties,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _row_provenance(row: Any) -> dict[str, Any]:
|
||||
if isinstance(row, Detection):
|
||||
return {
|
||||
"detection_id": str(row.id),
|
||||
"job_id": str(row.job_id) if row.job_id else None,
|
||||
"confidence": row.confidence,
|
||||
"model_name": row.model_name,
|
||||
"model_version": row.model_version,
|
||||
"source_tile_path": row.source_tile_path,
|
||||
"bbox_json": row.bbox_json,
|
||||
}
|
||||
if isinstance(row, Segmentation):
|
||||
return {
|
||||
"segmentation_id": str(row.id),
|
||||
"job_id": str(row.job_id) if row.job_id else None,
|
||||
"confidence": row.confidence,
|
||||
"model_name": row.model_name,
|
||||
"model_version": row.model_version,
|
||||
"source_tile_path": row.source_tile_path,
|
||||
"bbox_json": row.bbox_json,
|
||||
"mask_path": row.mask_path,
|
||||
"area_m2": row.area_m2,
|
||||
}
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user