当前位置:网站首页>OpenPose的使用
OpenPose的使用
2022-07-02 13:57:00 【呼叫冰河谷】
介绍
the first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints (in total 135 keypoints) on single images.(在一张图片上对人体、手部、面部、足部关节点检测的首个实时多人系统)
下载代码
去Github去clone:https://github.com/CMU-Perceptual-Computing-Lab/openpose
安装CMake
下载好后默认安装即可,然后添加环境变量
下载pybind11(下载Zip包即可)
GitHub - pybind/pybind11 at 085a29436a8c472caaaf7157aa644b571079bcaa
下载完成后放入openpose的3rdparty\pybind11文件夹下
下载Caffe(下载Zip包即可)
下载完成后放入openpose的3rdparty\caffe文件夹下
安装Cuda
CUDA Toolkit 11.7 Downloads | NVIDIA Developer
默认安装即可
下载Cudnn
cuDNN Archive | NVIDIA Developer
先去到这个地址,然后复制下载链接到迅雷下载即可,因为直接点链接下载经常加载不进去页面(此外,还需要用邮箱注册一下)
解压后有三个文件夹bin
、include
和lib
,依次将三个文件夹中的内容拷贝到cuda
的安装目录(默认情况下是C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
)下的bin
、include
和lib
下,这个要一一对应,如下图所示。
找到Visual Studio Installer, 点击修改
选择单个组件,搜索Cmake,勾选并点击修改
搜索Windows 10 SDK勾选
编译openpose代码
在openpose文件夹下新建build文件夹
配置路径,第一个框是openpose源码的文件夹,第二个框里填的是生成路径
然后点击Configure,选择VS2022,然后Finish
然后打开Build Python,然后点击Configure
然后点击Generate
然后点击open Project,在VS中打开编译好的项目
然后鼠标右键 OpenposeDemo选择生成
生成完成
我们可以看到,最后生成的exe文件
右键OpenPoseDemo,选择设为启动项目
然后运行,点击本地Windwos调试器,这时就会调用摄像头实时地识别人体关节点了
如果想使用某个视频文件来运行OpenPoseDemo
,可以在visual studio
中增加命令行参数,方法是右键打开解决方案中的OpenPoseDemo
,选择属性
选择调试,然后在命令参数输入:
--video C:\Users\hzkdediannao\Desktop\python\openpose\test.mp4 (这是视频保存的位置)
然后再次运行即可
运行时遇到的问题:
- Failed to parse NetParameter file: models\pose/body_25/pose_iter_584000.caffemodel
0x00007FF9F320286E (ucrtbase.dll) (OpenPoseDemo.exe 中)处有未经处理的异常: 请求了严重的程序退出。
编译遇到这个错误大概率是model没有下载全,去models目录下运行getModels.bat
然后我们尝试使用python调用
右键pyopenpose点击生成
然后将x64/Release下文件和python/openpose/Release下文件拷贝到bin目录下
然后把openpose下地models目录拷贝到bin目录下
然后在bin目录下新建一个data文件夹,来保存需要识别地图片或视频
然后我们先在cmd调用一下
然后我们在bin目录下打开Jupyter Notebook
然后新建一个ipynb文件,参考examples/tutorial_python/body_form_image.py下代码进行自定义编程
import pyopenpose as op
import matplotlib.pyplot as plt
import cv2
# Custom Params (refer to include/openpose/flags.hpp for more parameters)
params = dict()
params["model_folder"] = "./models/"
# Starting OpenPose
opWrapper = op.WrapperPython()
opWrapper.configure(params)
opWrapper.start()
# Process Image
datum = op.Datum()
imageToProcess = cv2.imread('data/test2.jpg')
imageToProcess = cv2.cvtColor(imageToProcess,cv2.COLOR_RGB2BGR)
plt.imshow(imageToProcess)
datum.cvInputData = imageToProcess
opWrapper.emplaceAndPop(op.VectorDatum([datum]))
# Display Image
print("Body keypoints: \n" + str(datum.poseKeypoints)) #X\Y\C(置信度)
plt.imshow(datum.cvOutputData)
可以看到有10个点
在图片中正好也有10个点
参考:
边栏推荐
- July 1st gift: Yi Jingjie's "hundred day battle" ended perfectly, and the database of Guiyang bank was sealed in advance
- PCL 最小中值平方法拟合平面
- Day 18 of leetcode dynamic planning introduction
- Yyds dry inventory uses thread safe two-way linked list to realize simple LRU cache simulation
- Global and Chinese markets for slotting milling machines 2022-2028: Research Report on technology, participants, trends, market size and share
- unity Hub 登录框变得很窄 无法登录
- 月报总结|Moonbeam6月份大事一览
- C语言中sprintf()函数的用法
- According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors
- Trigger: MySQL implements adding or deleting a piece of data in one table and adding another table at the same time
猜你喜欢
SQL solves the problem of continuous login deformation holiday filtering
July 1st gift: Yi Jingjie's "hundred day battle" ended perfectly, and the database of Guiyang bank was sealed in advance
Ranger (I) preliminary perception
DigiCert SSL证书支持中文域名申请吗?
七一献礼:易鲸捷 “百日会战”完美收官 贵阳银行数据库提前封板
易语言abcd排序
Analyzing more than 7million R & D needs, it is found that these eight programming languages are the most needed in the industry!
Sim2real environment configuration tutorial
pwm呼吸灯
SSM integration exception handler and project exception handling scheme
随机推荐
<四> H264解码输出yuv文件
How to choose the right kubernetes storage plug-in? (09)
What is normal distribution? What is the 28 law?
July 1st gift: Yi Jingjie's "hundred day battle" ended perfectly, and the database of Guiyang bank was sealed in advance
LeetCode 5. 最长回文子串
vscode设置删除行快捷键[通俗易懂]
Global and Chinese markets for airport baggage claim conveyors 2022-2028: technology, participants, trends, market size and share Research Report
路由模式:hash和history模式
Masa framework - DDD design (1)
Global and Chinese market of jacquard looms 2022-2028: Research Report on technology, participants, trends, market size and share
Library management system (Shandong Agricultural University Curriculum Design)
MySQL port
忆当年高考|成为程序员的你,后悔了吗?
jsp 和 servlet 有什么区别?
深度学习图像数据自动标注[通俗易懂]
Sim2real environment configuration tutorial
Global and Chinese market of desktop hot melt equipment 2022-2028: Research Report on technology, participants, trends, market size and share
618 deep resumption: Haier Zhijia's winning methodology
C语言中sprintf()函数的用法
The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 releases | geek headlines