Stay organized with collections Save and categorize content based on your preferences.
public class ImageLabeling extends Object

Entry point to get an ImageLabeler for finding ImageLabels in a supplied image.

An image labeler is created via getClient(ImageLabelerOptionsBase).


 ImageLabeler imageLabeler = ImageLabeling.getClient(options); 

To perform label detection in an image, you first need to create an instance of InputImage from a Bitmap, ByteBuffer, etc. See InputImage documentation for more details. For example, the code below creates an InputImage from a Bitmap.

 InputImage image = InputImage.fromBitmap(bitmap, rotationDegrees); 

Then the code below can detect labels in the supplied InputImage.

 Task<List<ImageLabel>> task = imageLabeler.process(image);

Public Method Summary

static ImageLabeler
getClient(ImageLabelerOptionsBase options)
Gets an new instance of ImageLabeler that labels a supplied image.

Inherited Method Summary

Public Methods

public static ImageLabeler getClient (ImageLabelerOptionsBase options)

Gets an new instance of ImageLabeler that labels a supplied image.

To release the resources associated with a ImageLabeler, you need to ensure that ImageLabeler.close() is called on the resulting ImageLabeler instance once it will no longer be used.

options the options for the image labeler. It should be one of the concrete options like ImageLabelerOptions or CustomImageLabelerOptions.