Skip to main content
Version: Current

Image Classification Actions

os.openImageClassifier(options: ImageClassifierOptions): Promise<void>

Opens the image classifier with the given options. Returns a promise that resolves once the image classifier has been opened.

Sends the @onImageClassifierOpened shout once opened and the @onImageClassified shout every time an image has been classified.

The first parameter is a ImageClassifierOptions and is the options that should be used for the image classifier.

Examples

Open the image classifier.
await os.openImageClassifier({
modelUrl: 'MY_MODEL_URL'
});
Open the image classifier with a specific camera.
await os.openImageClassifier({
modelUrl: 'MY_MODEL_URL',
cameraType: 'front'
});

os.closeImageClassifier(): Promise<void>

Closes the image classifier. Returns a promise that resolves once the image classifier has been closed.

Also sends the @onImageClassifierClosed shout once closed.

Examples

Close the image classifier.
await os.closeImageClassifier();