用非Jupyter相机供稿替换ipywidgets和IPython.display

问题描述

我目前正在尝试在Jetson Xavier NX上运行姿态估计库,并在此处关注此演示: https://github.com/NVIDIA-AI-IOT/trt_pose/blob/master/tasks/human_pose/live_demo.ipynb

唯一的问题是,以下供稿显示仅在将自身嵌入Jupyter .ipynb文件时才起作用:

import ipywidgets
from IPython.display import display

image_w = ipywidgets.Image(format='jpeg')

display(image_w)

我尝试用OpenCV替换此代码(但帧速率较低且没有图形)。

cap = cv2.VideoCapture(0)
while True:
   ret,frame = cap.read()
   execute({'new' : frame})
   cv2.imshow('Pose Estimation',frame)
   if cv2.waitKey(1) & 0xFF == ord('q'):
      break
cap.release()
cv2.destroyAllWindows()

execute()是用户定义的函数,该函数将帧处理为张量并通过网络馈入,并绘制到帧上。但是我似乎无法将其绘制在框架上。任何帮助将不胜感激,谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...