DetectedObject.Label

  • DetectedObject.Label represents an image label for a detected object, providing information like confidence, index, and textual description.

  • The confidence score, ranging from 0.0f to 1.0f, indicates the certainty of the label assigned to the detected object.

  • Each label has a unique index, serving as an identifier among all supported labels by the classifier model.

  • The textual description of the label depends on the specific classifier model employed for object detection.

public static class DetectedObject.Label extends Object

Represents an image label of a detected object.

Public Method Summary

boolean
float
getConfidence()
Gets the confidence of this label.
int
getIndex()
Gets the index of this label.
String
getText()
Gets the text of this label.
int

Inherited Method Summary

Public Methods

public boolean equals (Object 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 ObjectDetector created with 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 ObjectDetector created with ObjectDetectorOptions, the index is one of the integer constants defined in PredefinedCategory.

public String getText ()

Gets the text of this label.

The text returned here depends on the classifier model used. For an ObjectDetector created with ObjectDetectorOptions, the text is one of the String constants defined in PredefinedCategory.

public int hashCode ()