fix(platform): govern geospatial analysis and raster handoffs
This commit is contained in:
@@ -34,6 +34,7 @@ from app.services.segmentation_adapter import (
|
||||
SamSegmentationAdapter,
|
||||
YoloSegmentationAdapter,
|
||||
)
|
||||
from app.services.tile_manifest_service import TileManifestService
|
||||
|
||||
|
||||
class SegmentationService:
|
||||
@@ -749,6 +750,18 @@ class SegmentationService:
|
||||
sam_adapter_class: type[SamSegmentationAdapter],
|
||||
) -> tuple[list[Segmentation], dict[str, Any]]:
|
||||
manifest = DetectionService._load_tile_manifest(tile_manifest_path, settings.yolo_max_tiles, settings)
|
||||
dataset = db.get(Dataset, dataset_id)
|
||||
if dataset is None:
|
||||
raise AppError(code="DATASET_NOT_FOUND", message="Dataset not found", status_code=404)
|
||||
manifest_binding = TileManifestService.validate_for_inference(
|
||||
db,
|
||||
dataset,
|
||||
manifest,
|
||||
manifest_path=tile_manifest_path or "",
|
||||
settings=settings,
|
||||
error_prefix="SEGMENTATION",
|
||||
)
|
||||
DetectionService._attach_tile_manifest_binding(analysis_run, job, manifest_binding)
|
||||
if model_name == settings.sam_model_id:
|
||||
model_path = Path(settings.sam_model_path or "").expanduser()
|
||||
allowed_frameworks = ("ultralytics/sam", "sam", "ultralytics", "pytorch")
|
||||
@@ -861,6 +874,7 @@ class SegmentationService:
|
||||
"duplicate_iou_threshold": float(settings.segmentation_duplicate_iou_threshold),
|
||||
"containment_suppression_threshold": float(settings.segmentation_containment_nms_threshold),
|
||||
"tile_manifest_path": str(Path(tile_manifest_path or "").expanduser()),
|
||||
"tile_manifest_binding": manifest_binding,
|
||||
"runtime_model_provenance": runtime_model_provenance.as_dict(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user