darcyai.perceptor.coral.image_classification_perceptor
ImageClassificationPerceptor Objects
class ImageClassificationPerceptor(CoralPerceptorBase)
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. - mean (
float
): The mean of the image. - std (
float
): The standard deviation of the image.
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[Class]
: A list of detected classes.
load
def load(accelerator_idx: [int, None]) -> None
Loads the image classification model.
Arguments
- accelerator_idx (
int
): The index of the Edge TPU to use.