Skip to content

Base

app.infrastructure.detection.model.base

View source code

Module for base; implements concrete processing and I/O behind application-facing contracts.

See Also

Layer: Infrastructure. Context: Implements concrete processing and i/o behind application-facing contracts at this architectural boundary.

BaseDetectionModel

Bases: ABC

Abstract base class for all detection model implementations (Torch, YOLO, Dummy).

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

detect(frame: np.ndarray, chosen_labels: list[str] | None = None) -> list[DetectionResult] abstractmethod

Run inference on frame, optionally filtering to chosen_labels.

PARAMETER DESCRIPTION
frame

RGB image array to process.

TYPE: ndarray

chosen_labels

Optional labels to retain in the returned detections.

TYPE: list[str] | None DEFAULT: None

RETURNS DESCRIPTION
list[DetectionResult]

Detection results for the frame, restricted to chosen_labels when provided.