# DetectedObject.Label

public static class **DetectedObject.Label** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Represents an image label of a detected object.

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) o) |
| float | [getConfidence](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label#getConfidence())() Gets the confidence of this label. |
| int | [getIndex](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label#getIndex())() Gets the index of this label. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getText](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label#getText())() Gets the text of this label. |
| int | [hashCode](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label#hashCode())() |

### 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 boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) o)

#### public float **getConfidence** ()

Gets the confidence of this label.

The range of this confidence depends on the classifier model used, but by convention
it should be \[0.0f, 1.0f\].

For an `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetector`
created with `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions`, the range is \[0.0f, 1.0f\].

#### public int **getIndex** ()

Gets the index of this label.

This is the index of this label among all the labels the classifier model supports.
It can be used as a unique identifier of this label.

For an `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetector`
created with `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions`, the index is one of the integer constants defined in
`https://developers.google.com/android/reference/com/google/mlkit/vision/objects/defaults/PredefinedCategory`.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getText** ()

Gets the text of this label.

The text returned here depends on the classifier model used. For an `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetector`
created with `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions`, the text is one of the String constants defined in
`https://developers.google.com/android/reference/com/google/mlkit/vision/objects/defaults/PredefinedCategory`.

#### public int **hashCode** ()