Skip to main content
Version: 0.10.0

Type Alias: Classifier<L>

Classifier<L> = object

Defined in: extensions/cv/tasks/classification.ts:72

Image classification task runner.

Type Parameters​

L​

L

The type representing the classification labels.

Properties​

classify()​

readonly classify: (input, options?) => Promise<Classification<L>[]>

Defined in: extensions/cv/tasks/classification.ts:89

Performs asynchronous image classification on the given input image.

Parameters​

input​

ImageBuffer

The input image buffer.

options?​

ClassifyOptions

Configuration options for classification. See ClassifyOptions.

Returns​

Promise<Classification<L>[]>

A promise resolving to the list of classifications sorted by confidence.

Throws​

With code INVALID_ARGUMENT if topk is negative, RESOURCE_BUSY if the model is in use, or RESOURCE_DISPOSED if disposed.


classifyWorklet()​

readonly classifyWorklet: (input, options?) => Classification<L>[]

Defined in: extensions/cv/tasks/classification.ts:98

Synchronous version of classify to be executed directly on the caller or worklet thread.

Parameters​

input​

ImageBuffer

options?​

ClassifyOptions

Returns​

Classification<L>[]


dispose()​

readonly dispose: () => void

Defined in: extensions/cv/tasks/classification.ts:76

Releases all allocated native resources.

Returns​

void