Skip to content

Loader

app.infrastructure.detection.model.loader

View source code

Detection model factory and polymorphic implementations (Torch, YOLO, Dummy).

See Also

Layer: Infrastructure. Context: Implements concrete processing and I/O behind application-facing contracts.

load_detection_model(model_name: str) -> BaseDetectionModel

Instantiate the model implementation registered under model_name.

PARAMETER DESCRIPTION
model_name

Registered model name, or "None" to select the dummy model.

TYPE: str

RETURNS DESCRIPTION
BaseDetectionModel

Model implementation for the requested TorchVision, YOLO, MTCNN, or dummy model.

Note

TorchVision, YOLO, and MTCNN names select their matching backend wrapper.

RAISES DESCRIPTION
DetectionModelError

If the name is not registered by any supported backend.