feat: add governed nationwide AOI orchestration and CUDA enforcement
This commit is contained in:
@@ -10,6 +10,7 @@ from app.services.segmentation_adapter import (
|
||||
YoloSegmentationAdapter,
|
||||
)
|
||||
from app.services.yolo_adapter import YoloDetectionAdapter
|
||||
from app.core.errors import AppError
|
||||
|
||||
|
||||
class ModelRegistryService:
|
||||
@@ -224,16 +225,24 @@ class ModelRegistryService:
|
||||
elif not model_path.exists() or not model_path.is_file():
|
||||
limitation = "YOLO_MODEL_PATH does not point to an existing local model file. GeoIntel will not download model weights automatically."
|
||||
else:
|
||||
configured = True
|
||||
status = "configured"
|
||||
limitation = "Configured for local YOLO inference over an existing raster tile manifest."
|
||||
try:
|
||||
validate_runtime = getattr(yolo_adapter_class, "validate_runtime", None)
|
||||
if validate_runtime is not None:
|
||||
yolo_adapter_class(settings).validate_runtime()
|
||||
except AppError as exc:
|
||||
status = "accelerator_unavailable"
|
||||
limitation = exc.message
|
||||
else:
|
||||
configured = True
|
||||
status = "configured"
|
||||
limitation = "Configured for local YOLO inference over an existing raster tile manifest within its validated area scope."
|
||||
|
||||
return DetectionModelCapability(
|
||||
model_id=settings.yolo_model_id,
|
||||
display_name=settings.yolo_model_display_name,
|
||||
framework="ultralytics/pytorch",
|
||||
task_type="object_detection",
|
||||
supported_classes=["building", "road", "water", "landuse"],
|
||||
supported_classes=[value.strip().lower() for value in settings.yolo_model_classes.split(",") if value.strip()],
|
||||
configured=configured,
|
||||
status=status,
|
||||
limitation_message=limitation,
|
||||
|
||||
Reference in New Issue
Block a user