darcyai.perceptor.cpu.image_classification_perceptor
ImageClassificationPerceptor Objects
class ImageClassificationPerceptor(CpuPerceptorBase)
ImageClassificationPerceptor is a class that implements the Perceptor interface for image classification.
Arguments
- threshold (
float
): The threshold for object detection. - top_k (
int
): The number of top predictions to return. - 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[Class]
Runs the image classification model.
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 classes and the labels.
load
def load(accelerator_idx: [int, None]) -> None
Loads the image classification model.
Arguments
- accelerator_idx (
int
): Not used.