前言
OpenPose是由CMU推出,用于实时检测图片中的人体、手、人脸和脚的关键点,一共135个关键点。支持多人检测。对于需要用到人体姿态的研究帮助很大。
OpenPose安装和测试
本文主要参考OpenPose官方安装文档。对于Cmake-GUI的部分使用直接改写CMakeLists.txt完成。
拉取源码和子模块源码
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git
拉取子模块源码(caffe和pybind):
cd openpose/
git submodule update --init --recursive --remote
模型提前下载和存放
OpenPose用到了包括人体、手、人脸和脚等5个模型,由于网速原因最好不要在编译过程中下载,尽量提前下载好存放到指定路径。
下载模型文件:
下载好模型文件后解压并放进对应指定目录。
安装所需依赖环境
安装hdf5、atlas、boost、protobuf依赖包,注意使用root安装,或使用sudo权限安装。
hdf5安装:
apt install libhdf5-dev
atlas安装:
apt install libatlas-base-devlib
boost安装:
两种安装方式选其一。
apt安装:
apt install boost-all-dev
源码安装:
wget -O boost_1_55_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download
tar xzvf boost_1_55_0.tar.gz
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local
./b2
./b2 install
/bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/boost.conf'
ldconfig
cat /usr/local/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
打印内容:
protobuf安装:
apt install protobuf-compiler libgoogle-glog-dev
apt-get install libprotobuf-dev
编译安装
cmake ../
打印信息:
make -j8
打印信息:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at cmake/Misc.cmake:32 (set):
implicitly converting 'BOOLEAN' to 'STRING' type.
Call Stack (most recent call first):
CMakeLists.txt:25 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking