旅游网站模板大全,哪个网站做视频挣钱,绍兴网站建设方案托管,做seo怎么设计网站目的复现代码完成视频中的人体姿态识别复现过程视频来源#xff1a;https://www.youtube.com/watch?vcMhWNGBW1Xgwww.youtube.com视频动图检测结果下载的画质本来就不高#xff0c;再加上两次录屏#xff0c;画质比较渣。首先确认工程所需要的依赖#xff1a;python3ten…目的复现代码完成视频中的人体姿态识别复现过程视频来源https://www.youtube.com/watch?vcMhWNGBW1Xgwww.youtube.com视频动图检测结果下载的画质本来就不高再加上两次录屏画质比较渣。首先确认工程所需要的依赖python3tensorflow 1.4.1opencv3, protobuf, python3-tkslidingwindow然后进行安装$ git clone https://www.github.com/ildoonet/tf-pose-estimation$ cd tf-pose-estimation$ pip3 install -r requirements.txt这里我的当前的环境中pip对应的版本是python3所以修改该命令为pip install -r requirements.txt遇到以下问题Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/Collecting githttps://github.com/ppwwyyxx/tensorpack.gitCloning https://github.com/ppwwyyxx/tensorpack.git to /tmp/pip-req-build-d9276zkbComplete output from command python setup.py egg_info:Traceback (most recent call last):File , line 1, in File /tmp/pip-req-build-d9276zkb/setup.py, line 7, in assert version 30, Tensorpack installation requires setuptools 30AssertionError: Tensorpack installation requires setuptools 30----------------------------------------Command python setup.py egg_info failed with error code 1 in /tmp/pip-req-build-d9276zkb/根据提示是因为setuptools版本太低于是更新pip install --ignore-installed --upgrade setuptools后续又提示几个依赖出现同样的版本问题可以用上面的命令逐一更新。最后安装成功显示Successfully built tensorpackInstalling collected packages: tensorpackSuccessfully installed tensorpack-0.9.4然后编译C库$ cd tf_pose/pafprocess$ swig -python -c pafprocess.i python3 setup.py build_ext --inplace输出swig -python -c pafprocess.i python setup.py build_ext --inplaceThe program swig can be found in the following packages:* swig* swig2.0Try: sudo apt install 根据提示安装swigsudo apt install swig再次运行swig -python -c pafprocess.i python setup.py build_ext –inplace接着遇到了CUDA版本的问题ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory因为之前在python27虚拟环境中使用cuda8现在在python3中使用cuda10所以需要更换cuda的路径这里可以参考shellyfung人体姿态识别--AlphaPoseTensorFlowzhuanlan.zhihu.com更换之后运行demopython run.py --modelmobilenet_thin --resize432x368 --image./images/p1.jpg输出以下信息Status: CUDA driver version is insufficient for CUDA runtime version这里需查看以下内容NVIDIA驱动CUDA版本tensorflow版本这三者之间是有版本对应关系的因为目前切换了cuda10而对应的nvidia驱动版本过低因此重新安装NVIDIA驱动这里大家可以参考网络上的教程卸载的方式和你安装的方式最好是对应的。安装完成之后使用nvidia-smi查看安装结果。然后运行python run.py --modelmobilenet_thin --resize432x368 --image./images/p1.jpg可以在对应的路径下查找输出的结果。检测视频作者提供了一个摄像头实时检测的脚本python run_webcam.py --modelmobilenet_thin --resize432x368 --camera0因为我要检测视频所以需要修改部分内容。打开run_webcam.py查看读取摄像头的代码作者是使用opencv读取的摄像头而在opencv中读取摄像头和读取视频使用的方法是一样的只不过需要修改传入参数。首先在本地测试读入视频代码如下:import cv2import numpy as npcap cv2.VideoCapture(video.mp4)while 1:ret, frame cap.read()cv2.imshow(capture, frame)if cv2.waitKey(100) 0xFF ord(q):breakcap.release()cv2.destroyAllWindows()可以成功读取视频只不过使用的是cpu画面非常的卡顿。接着修改脚本中的参数# parser.add_argument(--camera, typeint, default0)parser.add_argument(--camera, typestr, default0x0)然后在终端运行python run_webcam.py --modelmobilenet_thin --resize432x368 --cameravideo.mp4只需要将—camera后面的内容修改为视频的名称就可以前提是视频需要和脚本放在同一目录下。然后就可以看到输出结果了视频截图可以看到在某些动作比较快的画面下检测结果的丢帧还是存在的。完整检测后的视频链接https://youtu.be/zdIyKFJ4xzgyoutu.be