Skip to content

Mapper

app.infrastructure.detection.model.yolo.mapper

View source code

Mapper for converting Ultralytics YOLO model output to DetectionPayload.

See Also

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

YoloDetectionMapper

Maps raw YOLO detection results to DetectionPayload format.

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

map(results: list, chosen_labels: list[str] | None = None) -> list[DetectionResult] staticmethod

Map YOLO raw inference output to DetectionResult list.

PARAMETER DESCRIPTION
results

Raw YOLO model output (list of Result objects).

TYPE: list

chosen_labels

Optional filter to include only these labels.

TYPE: list[str] | None DEFAULT: None

RETURNS DESCRIPTION
list[DetectionResult]

List of DetectionResult instances filtered by confidence and label.