Detection Engine Adapter
app.infrastructure.adapters.detection_engine_adapterExplicit adapter wrapping DetectionEngine to DetectionEngineInterface.
See Also
DetectionEngineInterface— defines the exposed engine contractDetectionEngine— concrete engine being adapted
Layer: Infrastructure. Context: Implements concrete processing and I/O behind application-facing contracts.
DetectionEngineAdapter
Bases: DetectionEngineInterface
Explicit adapter that wraps a concrete DetectionEngine instance and
exposes the DetectionEngineInterface contract.
In normal usage the concrete DetectionEngine already satisfies
DetectionEngineInterface via structural subtyping (Protocol), so
this adapter is not required for runtime correctness. It exists to:
- Provide an explicit, named boundary at the infrastructure/application seam.
- Enable test doubles that replace the real model without subclassing
DetectionEngine. - Act as the canonical reference implementation of the interface.
| PARAMETER | DESCRIPTION |
|---|---|
engine
|
Concrete detection engine delegated to by this adapter.
TYPE:
|
model_name: str
property
Return the configured detection model name.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Name of the model currently loaded by the wrapped engine. |
__init__(engine: DetectionEngine) -> None
detect(frame: np.ndarray) -> list[DetectionResult]
Run detection on the supplied frame.
| PARAMETER | DESCRIPTION |
|---|---|
frame
|
RGB image array to pass to the wrapped engine.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[DetectionResult]
|
Detection results produced by the wrapped engine. |
set_model(model_name: str) -> None
Load and select a different detection model.
| PARAMETER | DESCRIPTION |
|---|---|
model_name
|
Registered name of the model to load.
TYPE:
|