Original: Github Project-OpenPose Installation on Ubuntu-AIUAI
Github Project-openpose
Team: CMU-Perceptual-Computing-Lab
OpenPose, a powerful open source project for pose estimation, including Body, Face, Hands, 3D Reconstruction, etc.

OpenPose is a real-time multi-person detection system for key points such as the body, hand, and face of a single image (135 in total) key point).

For more update details, refer to: all released features and release notes.
1. Features
[1] - 2 D Real-time multi-person key point detection
[2] - 3 D Real-time single person key point detection
[3] - Calibration toolbox (Calibration toolbox)
[4] - Single-person tracking (Single-person tracking)
2. Input
3. Output
4. Support System (OS)
5. other
1. Body-Foot Estimation

2. Body, Face, Hands estimate

3. 3 D Reconstruction module

4. Body and Hands estimate

5. Body estimate

The OpenPose support platform is relatively rich, but the installation instructions provided are relatively large, here only the instructions for the personal installation process are combined.
Do not install Anaconda-Anaconda's Protobuf version is not compatible with Caffe in OpenPose (this seems to be solved by using a custom version of Caffe).
Install CMake GUI.
sudo apt-get install cmake-qt-gui
Nvidia GPU-OpenPose tested on CUDA8.0 and cuDNN5.1. Personal installation environment: CUDA9.0 and cuDNN7.1.4.
Caffe
[1] - Open the CMake GUI and select the OpenPose path as the project source code path and the corresponding build compilation path. If the build path does not exist, YES will appear to automatically create it.

[2] - Click on the Configure option, then Unix Makefile (Ubuntu), and finally Finish.

[3] - Click the Generate option to close CMake.
**Note: **If you need to use Python API, you need to select BUILD_PYTHON after [2] Configure, such as:

cd OPENPOSE_ROOT/build/
make -j`nproc`
Compilation is correct.
[1] - Do not use cuDNN when compiling:
In the OpenPose configuration, uncheck the USE_CUDNN of CMake.
If cuDNN is not used, you need to reduce the size set by --net_resolution to avoid insufficient GPU memory.
- - net_resolution can try: 640x320, 320x240, 320x160, 160x80.
Such as: --net_resolution -1x320.
**[2] - Custom Caffe version: **
In the OpenPose configuration, remove the check of CMake's BUILD_CAFEE, and manually define the Caffe include path and library path.

**[3] - Custom OpenCV version: **
In the OpenPose configuration, if OpenCV is compiled and installed from the source code, and OpenPose cannot find the OpenCV path, you can manually specify the OPENCV_DIR path.
If you have already used CMake GUI to configure compilation, this part is unnecessary.
[1] - Create the OPENPOSE_ROOT/build path:
cd OPENPOSE_ROOT/build
mkdir build
cd build
[2] - Generate Makefiles files. There are several scenarios at this time: Caffe can be a user-defined installation version; or a Caffe version integrated in OpenPose.
Scenario 1-Caffe is not installed, OpenCV is installed with apt-get
cd build
cmake ..
Scenario 2-Caffe is installed, and OpenCV is installed using source code
Assume that Caffe and OpenCV already exist.
Then, you need to provide CMake with libraries path and include path.
For OpenCV, use OpenCV_INCLUDE_DIRS and OpenCV_LIBS_DIR to specify the libraries path and the include path of the OpenCV installation. Alternatively, you can also set the OpenCV_CONFIG_FILE to specify the path of OpenCVConfig.cmake.
For Caffe, use Caffe_INCLUDE_DIRS and Caffe_LIBS to specify the libraries path and include path for Caffe installation.
Such as:
cmake -DOpenCV_INCLUDE_DIRS=/home/"${USER}"/softwares/opencv/build/install/include \
- DOpenCV_LIBS_DIR=/home/"${USER}"/softwares/opencv/build/install/lib \
- DCaffe_INCLUDE_DIRS=/home/"${USER}"/softwares/caffe/build/install/include \
- DCaffe_LIBS=/home/"${USER}"/softwares/caffe/build/install/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
cmake -DOpenCV_CONFIG_FILE=/home/"${USER}"/softwares/opencv/build/install/share/OpenCV/OpenCVConfig.cmake \
- DCaffe_INCLUDE_DIRS=/home/"${USER}"/softwares/caffe/build/install/include \
- DCaffe_LIBS=/home/"${USER}"/softwares/caffe/build/install/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
Scenario 3-OpenvCV is installed
If Caffe is not installed, but OpenCV is installed:
cmake -DOpenCV_INCLUDE_DIRS=/home/"${USER}"/softwares/opencv/build/install/include \
- DOpenCV_LIBS_DIR=/home/"${USER}"/softwares/opencv/build/install/lib ..
cmake -DOpenCV_CONFIG_FILE=/home/"${USER}"/softwares/opencv/build/install/share/OpenCV/OpenCVConfig.cmake ..
OpenPose's Python API requires setting BUILD_PYTHON in CMake GUI.
Such as: ./build/examples/tutorial_developer/python_1_pose_from_heatmaps.py.
In order to manually select the CPU version, set GPU_MODE to CPU_ONLY in CMake GUI.
Note: The accuracy of the CPU version is about 1% higher than that of the CUDA version. So the results may be different.
OpenPose in Ubuntu uses the Intel MKL (Math Kernel Library) version of Caffe. You can also use a custom Caffe version by deselecting USE_MKL.
The default CPU version is about 0.2 images per second on Ubuntu (~50X slower than the GPU version). The MKL version can increase the speed by 2X, ~0.4 images per second.
[1] - If you run sudo make install, first run sudo make uninstall in build/.
[2] - Delete the build/ path.
[3] - In CMake GUI, click File-Delete Cache.
[4] - Reinstall. (or delete the OPENPOSE_ROOT/ path.)
Recommended Posts