Skip to content

Loader Factory

app.infrastructure.detection.model.yolo.loader_factory

View source code

Factory for loading Ultralytics YOLO detection model.

See Also

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

YoloModelLoaderFactory

Factory for loading Ultralytics YOLO detection model.

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

create(model_file_name: str) -> YOLO staticmethod

Load YOLO model by model_file_name (e.g., "yolov8n.pt").

RETURNS DESCRIPTION
YOLO

Loaded YOLO model instance.

RAISES DESCRIPTION
DetectionModelError

If Ultralytics is not installed or model loading fails.