DetectedObject.Label
Represents an image label of a detected object.
Public Method Summary
boolean |
|
float |
|
int |
getIndex()
Gets the index of this label.
|
String
|
getText()
Gets the text of this label.
|
int |
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
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
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["`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."]]],["The `DetectedObject.Label` class represents a label for a detected object in an image. It provides methods to access label information: `getConfidence()` returns the confidence score (typically between 0.0f and 1.0f), `getIndex()` returns a unique integer identifier for the label, and `getText()` returns the textual representation of the label. Additionally, `equals()` and `hashCode()` methods are included for object comparison and hashing, respectively. It also inherit other method from the Object class.\n"]]