Function: createClassifier()
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.
Type Parameters
L
L
The type representing the classification labels.
Parameters
config
Classifier task configuration containing path and options. See ClassifierModel.
runtime?
any
Optional worklet runtime thread on which to run the model execution.
Returns
Promise<Classifier<L>>
A promise resolving to the instantiated Classifier runner.
Throws
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.