createClassifier<
L>(config,runtime?):Promise<Classifier<L>>
Defined in: extensions/cv/tasks/classification.ts:120
Creates an image classifier runner for executing local Image Classification models.
It validates the model inputs and outputs requirements, asserts that the labels array length matches the model's output vocabulary size, pre-allocates the necessary static execution tensors, sets up an image preprocessor, and registers clean disposal hooks to clear all native memory.
L
The type representing the classification labels.
Classifier task configuration containing path and options. See ClassifierModel.
WorkletRuntime
Optional worklet runtime thread on which to run the model execution.
Promise<Classifier<L>>
A promise resolving to the instantiated Classifier runner.
With code LOAD_FAILED if model fails to load,
SCHEMA_MISMATCH if model schema does not match classification spec, or
INVALID_ARGUMENT if labels length does not match model output classes.