darcyai.perceptor.cpu.object_detection_perceptor
ObjectDetectionPerceptor Objects
class ObjectDetectionPerceptor(CpuPerceptorBase)
ObjectDetectionPerceptor is a class that implements the Perceptor interface for object detection.
Arguments
- threshold (
float
): The threshold for object detection. - labels_file (
str
): The path to the labels file. - labels (
dict
): A dictionary of labels. - quantized (
bool
): Whether the model is quantized. - num_cpu_threads (
int
): The number of threads to use for inference (CPU). Defaults to 1.
run
def run(input_data: Any, config: ConfigRegistry = None) -> List[Object]
Runs the object detection model on the input data.
Arguments
- input_data (
Any
): The input data to run the model on. - config (
ConfigRegistry
): The configuration for the Perceptor.
Returns
(list[Any], list(str))
: A tuple containing the detected objects and the labels.
load
def load(accelerator_idx: [int, None] = None) -> None
Loads the object detection model.
Arguments
- accelerator_idx (
int
): Not used.