提取检测到的类名 - 张量流对象检测 API



我的问题就是这个信息量极大的话题的后续。我要更进一步,只打印检测到的类名。

正如线程中回答的那样,我目前能够获得:[{'id: 4 , 'name': 'bottle'}]使用代码行print[category_index.get(value)

我一直在尝试仅隔离检测到的类名,以便我可以打印仅在终端上bottle的输出。 我需要在打印行中进行哪些更改才能完成此操作

试试这个:

def GetClassName(data):
for cl in data:
return cl['name']
#data processed
data = [category_index.get(value) for index,value in enumerate(classes[0]) if scores[0,index] > 0.9]
print(GetClassName(data))

最新更新