LabelUtil
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承的方法
继承自 java.lang.Object 类
布尔值
|
|
final
Class<?>
|
getClass()
|
整型
|
hashCode()
|
最终无效 |
notify()
|
最终无效 |
notifyAll()
|
字符串
|
toString()
|
最终无效 |
wait(long arg0, int arg1)
|
最终无效 |
wait(long arg0)
|
最终无效 |
wait()
|
公共方法
public
static
List<String>
mapValueToLabels
(TensorBuffer tensorBuffer, List<String> labels, int offset)
将 int 值张量映射到字符串标签列表。它接受一个字符串数组作为字典。示例:如果给定张量为 [3, 1, 0],并且给定标签为 ["background", "apple", "banana", "cherry", "date"],结果将为 ["date", "banana", "apple"]。
参数
tensorBuffer |
具有索引值的张量。值应为非负整数,且每个值 x 都将转换为 labels[x + offset] 。如果以浮点 TensorBuffer 的形式提供张量,则值将转换为整数。所有超出范围的值都将映射到空字符串。 |
标签 |
一个字符串列表,可用作要查找的字典。数组元素的索引将用作键。为了获得更好的性能,请使用实现 RandomAccess 的对象,例如 ArrayList 。 |
offset |
在 labels 中查找 int 值时的偏移值。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-05-14。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]