tensorflow/lite/g3doc/api_docs/java/org/tensorflow/lite/support/label/LabelUtil.html
public class LabelUtil
Label operation utils.
| static List<String> | mapValueToLabels(TensorBuffer tensorBuffer, List<String> labels, int offset) Maps an int value tensor to a list of string labels.
|
From class java.lang.Object
| boolean | equals(Object arg0) | | 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() |
Maps an int value tensor to a list of string labels. It takes an array of strings as the dictionary. Example: if the given tensor is [3, 1, 0], and given labels is ["background", "apple", "banana", "cherry", "date"], the result will be ["date", "banana", "apple"].
| tensorBuffer | A tensor with index values. The values should be non-negative integers, and each value x will be converted to labels[x + offset]. If the tensor is given as a float TensorBuffer, values will be cast to integers. All values that are out of bound will map to empty string. |
| labels | A list of strings, used as a dictionary to look up. The index of the array element will be used as the key. To get better performance, use an object that implements RandomAccess, such as ArrayList. |
| offset | The offset value when look up int values in the labels. |
TensorBuffer.getFlatSize().| IllegalArgumentException | if tensorBuffer or labels is null. |