# ImageLabeling

public class **ImageLabeling** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Entry point to get an `ImageLabeler`
for finding `ImageLabel`s in
a supplied image.

An image labeler is created via `
getClient(ImageLabelerOptionsBase)`.

Example:

     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);
     task.addOnSuccessListener(...).addOnFailureListener(...); 

### Public Method Summary

|---|---|
| static [ImageLabeler](https://developers.google.com/android/reference/com/google/mlkit/vision/label/ImageLabeler.md.txt) | [getClient](https://developers.google.com/android/reference/com/google/mlkit/vision/label/ImageLabeling.md.txt#getClient(com.google.mlkit.vision.label.ImageLabelerOptionsBase))([ImageLabelerOptionsBase](https://developers.google.com/android/reference/com/google/mlkit/vision/label/ImageLabelerOptionsBase.md.txt) options) Gets an new instance of `ImageLabeler` that labels a supplied image. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [ImageLabeler](https://developers.google.com/android/reference/com/google/mlkit/vision/label/ImageLabeler.md.txt)
**getClient** ([ImageLabelerOptionsBase](https://developers.google.com/android/reference/com/google/mlkit/vision/label/ImageLabelerOptionsBase.md.txt) 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.

##### Parameters

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