ImageLabel
bookmark_border
bookmark
Stay organized with collections
Save and categorize content based on your preferences.
Public Method Summary
boolean |
equals( Object o)
Indicates whether some other object is "equal to" this one.
|
float |
|
int |
getIndex()
Gets the index of this label.
|
String
|
getText()
Gets the text of this label.
|
int |
hashCode()
Returns a hash code value for the object.
|
String
|
|
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)
Indicates whether some other object is "equal to" this one.
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 ImageLabeler
created with ImageLabelerOptions
,
the range is [0.0f, 1.0f].
public int getIndex ()
Gets the index of this label.
The index maps to the detected label in the entire label map of the corresponding
model.
Indexes can be used as unique identifiers to match detected labels instead of super
long label names.
public String getText ()
Gets the text of this label.
The text returned here depends on the classifier model used.
public int hashCode ()
Returns a hash code value for the object.
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."],[[["\u003cp\u003e\u003ccode\u003eImageLabel\u003c/code\u003e represents an image label detected by ML Kit's \u003ccode\u003eImageLabeler\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access the label's text, confidence score, and index.\u003c/p\u003e\n"],["\u003cp\u003eConfidence scores range from 0.0f to 1.0f, indicating the likelihood of the label being correct.\u003c/p\u003e\n"],["\u003cp\u003eLabel indexes can be used as unique identifiers for detected labels.\u003c/p\u003e\n"]]],["The `ImageLabel` class represents a detected image label from an `ImageLabeler`. Key actions include: retrieving the label's text via `getText()`, obtaining its confidence score with `getConfidence()` (ranging from 0.0f to 1.0f), and getting its index with `getIndex()`. Additional methods are `equals()`, `hashCode()`, and `toString()`. Inherited methods from `java.lang.Object` offer object-level functionalities such as `clone`, `notify`, and `wait`.\n"],null,["public class **ImageLabel** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nRepresents an image label detected by [ImageLabeler](/android/reference/com/google/mlkit/vision/label/ImageLabeler). \n\nPublic Method Summary\n\n|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/vision/label/ImageLabel#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is \"equal to\" this one. |\n| float | [getConfidence](/android/reference/com/google/mlkit/vision/label/ImageLabel#getConfidence())() Gets the confidence of this label. |\n| int | [getIndex](/android/reference/com/google/mlkit/vision/label/ImageLabel#getIndex())() Gets the index of this label. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getText](/android/reference/com/google/mlkit/vision/label/ImageLabel#getText())() Gets the text of this label. |\n| int | [hashCode](/android/reference/com/google/mlkit/vision/label/ImageLabel#hashCode())() Returns a hash code value for the object. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/mlkit/vision/label/ImageLabel#toString())() |\n\nInherited Method Summary \nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods \n\npublic boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o) \nIndicates whether some other object is \"equal to\" this one. \n\npublic float **getConfidence** () \nGets the confidence of this label.\n\nThe range of this confidence depends on the classifier model used, but by convention\nit should be \\[0.0f, 1.0f\\].\n\nFor an [ImageLabeler](/android/reference/com/google/mlkit/vision/label/ImageLabeler)\ncreated with [ImageLabelerOptions](/android/reference/com/google/mlkit/vision/label/defaults/ImageLabelerOptions),\nthe range is \\[0.0f, 1.0f\\]. \n\npublic int **getIndex** () \nGets the index of this label.\n\nThe index maps to the detected label in the entire label map of the corresponding\nmodel.\n\nIndexes can be used as unique identifiers to match detected labels instead of super\nlong label names. \n\npublic [String](//developer.android.com/reference/java/lang/String.html) **getText** () \nGets the text of this label.\n\nThe text returned here depends on the classifier model used. \n\npublic int **hashCode** () \nReturns a hash code value for the object. \n\npublic [String](//developer.android.com/reference/java/lang/String.html) **toString** ()"]]