opencv - 无法使用 openvino 模型
问题描述
我正在使用来自 openvino的 person-detection-action-recognition-0005预训练模型来检测人员及其行为。
从上面的链接中,我编写了一个 python 脚本来进行检测。
这是脚本。
import cv2
def main():
print(cv2.__file__)
frame = cv2.imread('/home/naveen/Downloads/person.jpg')
actionNet = cv2.dnn.readNet('person-detection-action-recognition-0005.bin',
'person-detection-action-recognition-0005.xml')
actionBlob = cv2.dnn.blobFromImage(frame, size=(680, 400))
actionNet.setInput(actionBlob)
# detection output
actionOut = actionNet.forward(['mbox_loc1/out/conv/flat',
'mbox_main_conf/out/conv/flat/softmax/flat',
'out/anchor1','out/anchor2',
'out/anchor3','out/anchor4'])
# this is the part where I dont know how to get person bbox
# and action label for those person fro actionOut
for detection in actionOut[2].reshape(-1, 3):
print('sitting ' +str( detection[0]))
print('standing ' +str(detection[1]))
print('raising hand ' +str(detection[2]))
现在,我不知道如何从输出变量(actionOut)中获取 bbox 和动作标签。我找不到任何解释这一点的文档或博客。
有人有什么想法或建议,怎么做?
解决方案
推荐阅读
- python - python 应用程序的动态配置刷新
- python - 如何在pygame中修复这些圆圈的碰撞?
- c# - 关于使用 WindowsFormsHost 的问题。(使用数据绑定)
- vue.js - 使用 VueJS 即时更新图像 src
- reactjs - 了解 onClick 处理程序中的“this”上下文
- java - 我如何创建新线程来执行某些任务并在任务完成后停止线程
- c# - 在循环中的两点之间移动对象?
- matlab - 通过 FFT 进行整合/差异化
- java - 如何在 Android 中对 List 使用 forech 条件
- powerbi - 如何根据客户细分对我的巧克力切片机进行分类?