论文复现--OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields

本文详细介绍了如何在Windows10系统上下载OpenPose的依赖项(如pybind11和OpenCV),使用CMake生成工程文件,以及在VS2017中编译OpenPose并运行Demo。还包括了解决官方下载问题的替代链接。
摘要由CSDN通过智能技术生成

分类:动作捕捉
github地址:https://github.com/CMU-Perceptual-Computing-Lab/openpose
所需环境:Windows10,cmake3.27.1,Visual Stdio 2017(其他也可)


本环境配置主要参考这个帖子 1,有改动

下载依赖和模型

进入OpenPose的github项目中,点击3rdparty
在这里插入图片描述
点击pybind11,进入该项目并将该项目下载下来。pybind11用于OpenPose编译后可以通过python调用。
在这里插入图片描述
在这里插入图片描述
将pybind11压缩包解压,将其中的内容复制到之前解压好的OpenPose目录中的3rdparty/pybind11中。
在这里插入图片描述

在这里插入图片描述
进入本地3rdparty/windows目录中,双击执行其中的几个以bat为后缀名的批处理文件。它们会下载OpenPose项目所需要的caffe,opencv等框架。
在这里插入图片描述
然而实际上,bat脚本并不能下载。因为官网设置了访问权限,好像是因为访问的人太多了导致的2,3。。。
在这里插入图片描述
但是作者又给了结局方案,他直接上传到谷歌盘了3

G Drive version:
Models: https://drive.google.com/file/d/1QCSxJZpnWvM00hx49CJ2zky7PWGzpcEh
3rdparty before 2021: https://drive.google.com/file/d/1mqPEnqCk5bLMZ3XnfvxA4Dao7pj0TErr
3rdparty for 2021 versions: https://drive.google.com/file/d/1WvftDLLEwAxeO2A-n12g5IFtfLbMY9mG(现在是2023年,需要下载这个)
没法科学上网,可以使用我的链接:
链接:https://pan.baidu.com/s/1LzUWZCkV7pQpNq_DxPm3rw?pwd=1234
提取码:1234

在这里插入图片描述
所以直接下载模型和2021版的第三方库:会得到3rdparty_v1_2021.zipmodels.zip

3rdparty_v1_2021.zip解压到3rdparty/windows目录下,并解压依赖包。其中caffe由caffe_16_2020_11_14解压而来,opencv由opencv_450_v15_2020_11_18解压而来4
在这里插入图片描述

models.zip解压到models目录,并将解压后的face hand pose文件夹与原本的face hand pose文件夹合并。
在这里插入图片描述
合并后的文件夹如下:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

使用CMake生成openpose工程文件

打开Cmake-gui,第一行选中OpenPose的目录,第二行指定生成项目的路径,可以自行设置。
项目路径:D:/WLm_Project/MotionCatch/OpenPose/openpose-master
工程路径:D:/WLm_Project/MotionCatch/OpenPose/openpose-master/build
在这里插入图片描述
点击configure,由于我们需要编译64位的,这里选择win64。vs版本要与已安装的一致。点击finish就会自动进行配置。
在这里插入图片描述
待cmake配置完成(本机器已经之前安装过CUDA,所以不会报错,提示信息都是CMake警告。具体安装参考这个帖子),CMake输出以下信息:

CMake Warning (dev) at CMakeLists.txt:19 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19045.
The C compiler identification is MSVC 19.16.27045.0
The CXX compiler identification is MSVC 19.16.27045.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:34 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMAKE_VERSION = 3.27.1
CMake Warning (dev) at CMakeLists.txt:214 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6 (found version "11.6") 
Building with CUDA.
CMake Warning (dev) at CMakeLists.txt:353 (find_package):

找到BUILD_PYTHON,并打上勾,这样编译后才会生成可供python调用的包。
在这里插入图片描述
因为我们要编译GPU版本,所以GPU_MODE不变,依然是CUDA。
在这里插入图片描述
cudnn之前也配置过,所以USE_CUDNN标志位保持不变。

在这里插入图片描述
上面的操作执行完成后,点击generate进行生成。出现Generating Done后,点击Open Project便可自动打开vs2017.

完整版信息如下:

CMake Warning (dev) at CMakeLists.txt:19 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19045.
CMake Deprecation Warning at CMakeLists.txt:34 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMAKE_VERSION = 3.27.1
CMake Warning (dev) at CMakeLists.txt:214 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

Building with CUDA.
CMake Warning (dev) at CMakeLists.txt:353 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

Downloading windows dependencies...
opencv_450_v15_2020_11_18.zip already exists.
caffe3rdparty_16_2020_11_14.zip already exists.
caffe_16_2020_11_14.zip already exists.
Windows dependencies downloaded.
Adding Example Calibration
Adding Example tutorial_add_module_custom_post_processing
Adding Example tutorial_api_thread_1_user_processing_function
Adding Example tutorial_api_thread_2_user_input_processing_output_and_datum
Adding Example OpenPoseDemo
Adding Example 01_body_from_image_default
Adding Example 02_whole_body_from_image_default
Adding Example 03_keypoints_from_image
Adding Example 04_keypoints_from_images
Adding Example 05_keypoints_from_images_multi_gpu
Adding Example 06_face_from_image
Adding Example 07_hand_from_image
Adding Example 08_heatmaps_from_image
Adding Example 09_keypoints_from_heatmaps
Adding Example 10_asynchronous_custom_input
Adding Example 11_asynchronous_custom_input_multi_camera
Adding Example 12_asynchronous_custom_output
Adding Example 13_asynchronous_custom_input_output_and_datum
Adding Example 14_synchronous_custom_input
Adding Example 15_synchronous_custom_preprocessing
Adding Example 16_synchronous_custom_postprocessing
Adding Example 17_synchronous_custom_output
Adding Example 18_synchronous_custom_all_and_datum
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
'git' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

CMake Deprecation Warning at 3rdparty/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at 3rdparty/pybind11/tools/pybind11Tools.cmake:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  3rdparty/pybind11/CMakeLists.txt:33 (include)


CMake Warning (dev) at 3rdparty/pybind11/tools/FindPythonLibsNew.cmake:60 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  3rdparty/pybind11/tools/pybind11Tools.cmake:16 (find_package)
  3rdparty/pybind11/CMakeLists.txt:33 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

pybind11 v2.3.dev0
Configuring done (2.8s)
Generating done (0.9s)

使用VS2017编译源码

手动打开build中的OpenPose.sln工程文件,配置管理器选择Release x64。选中OpenPoseDemo项目,右键-重新生成,即可编译OpenPose源代码,生成可执行文件。右侧还有数十个Demo可以编译。也可以通过上方的生成-生成解决方案进行整个项目的编译。
在这里插入图片描述
编译生成的可执行文件会放在x64/Release文件夹下。
在这里插入图片描述
在这里插入图片描述

运行OpenPoseDemo

直接点击运行或者ctrl+F5即可打开摄像头。
在这里插入图片描述
此外,官方还提供了很多API,可以自行编译。运行下很有趣,依赖的媒体在examples文件夹
如08_heatmaps_from_image,就是制作heatmap用的。
在这里插入图片描述

参考链接

1.Windows10编译CPU版OpenPose
2.MSVC OpenPose failed to download windows dependencies #2227
3.Unable to fetch/download models #1602
4.windows编译openpose及在python中调用

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 实时多人二维姿态估计使用的是部件关联场技术。该技术利用深度学习网络对图像中的人体关键点进行检测和定位,并通过学习人体部位之间的关联性来提高姿态估计的准确性。在实时性方面,该技术利用高效的网络结构和并行计算技术,能够在处理多人图像时保持较高的处理速度和较低的延迟。 ### 回答2: 实时的多人2D姿态估计是指在照片或视频中同时检测多个人的姿态并实时反馈结果。这个任务主要是依赖计算机视觉领域的人体关键点检测技术。而Part Affinity Fields(PAF)是现在最常用的一种检测方法。 PAF可以理解为是人体姿态中的“骨架”,它在这里指的是需要将骨骼节点间的关系一同考虑进去来提高精度的设计。每个PAF都对应着一对关联的节点,例如手臂这一关节对应的PAF就是肩膀和手腕两个关键点中间的向量场。PAF能够将关键点之间的联系编码为一个向量场,并将它们的图像位置和方向作为通道特征,这样就可以通过深度卷积网络获得节点的连接信息。 对于多人2D姿态估计任务,PAF可以自动推断出人体的椭圆形状,使得不同人的节点互相不干扰,能够高效地分离不同人体之间的关键点信息,保证检测精度。 总体而言,实时的多人2D姿态估计技术是计算机视觉研究领域中一个非常重要的方向。通过Part Affinity Fields技术,可以实现对人体姿态的快速准确检测和分析,并具有广泛的应用前景,比如拍摄跳舞类视频、体育比赛等。未来,该领域还将会不断提高研究和开发技术,提高其在实际场景中的使用效果,为人们的生产和生活提供更多更好的便利。 ### 回答3: 在计算机视觉领域,人体姿态估计一直是一个十分重要的研究方向。现在,研究者们正在致力于开发实时多人二维姿态估计方法,本文将介绍一种方法——part affinity fields。 Part affinity fields是指身体部位之间存在的空间关系矩阵。多人姿态估计就是先将图像中的每一个像素与人体相关的身体部件联系起来,然后再利用network output将这些点连接起来形成人体姿态。part affinity fields的基本思想是采用CNN对每一个像素做预测,以定位人体骨架上的每一个连接点。 主要步骤: 1.生成部件置信图:对于输入的图像,通过CNN估计每个像素是否为其中每个身体部位的一部分,这个图叫做部件置信图(Part Confidence Maps),可以通过训练数据集来检测出身体部位的位置。 2.生成连接部件映射图:对于预测出来的部件置信图,我们可以通过预测到的部件之间的关系来学习生成连接映射图(Part Affinity Fields),即学习两个不同身体部件之间的关系(connectivity),这个关系是一个形状为“c&times;2&times;h&times;w”的4维张量。在测试阶段,对于输入图像中的每个像素,都会有其对应到一个连接部件映射图的位置。 3.生成姿态结果:最后,我们将生成的部件置信图和连接部件映射图进行联合,把已确定的部件通过连接映射图装配起来并组合成人体的姿态结果。 这种方法最大的好处就是实现了实时多人姿态估计,不需要预设一个特定数量的人数。同时,在处理不同人的关键点时,以前的方法通常是对每个人都单独进行估计,而这个方法则对所有人的关键点一起进行估计,能够更好地处理人际交互。 总之,通过深度学习和部件置信图与连接映射图等技术手段的利用,Part Affinity Fields在解决实时多人二维姿态估计时具有很大的潜力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值