Skip to main content

Detection

Detection encapsulates object detection, model switching, and detection result drawing capabilities.

Signature:

Detection(
model: str = "default",
backend: str = "local",
**kwargs: Any,
) -> Detection

Description:

Create and initialize a detector.

Parameters:

Parameter

Type

Default

Description

model

str

"default"

Model ID or local model path.

backend

str

"local"

Inference backend; currently supports "local".

device

str | None

None

Inference device, e.g., "cpu", "cuda:0".

engine

str | None

Model default

Local inference engine; supports "yolo", "onnx", "tensorrt".

providers

list[str] | None

None

ONNX Runtime provider list.

Returns:

Detection

Initialized detector instance.

Raises:

ValueError: Unsupported backend, engine, or model file.

ImportError: Missing dependencies for the selected inference engine.

RuntimeError: Failed to load inference engine model.

Example:

from boosteros.brain import Detection

detector = Detection(model="default", backend="local")