Installation of Openpose(CPU only, Windows 10)

JPPPPP
UCL-COMP0016–2020-Team13
4 min readFeb 17, 2021

It was particularly difficult for me to install Openpose on my computer, with a Windows 10 platform

MANUAL DOWNLOADING:(skip if you are not downloading from China)

As I was trying to download the module and all the dependencies in China, it was not easy for me to download them, using terminals, CMAKE or other downloading tools would usually give me a downloading speed which was less than 10kb/s and ReadTimeoutErrors were constantly raised. It took me a while to find out how I can solve the issue.

The Openpose package was relatively big to download, having a download speed at 30kb/s is not going to be helpful. Using transfer station of Github code will be helpful, it helped me to achieve a download speed of 3MB/s which is about 100 times faster than that if I use terminal to download.

Although CMAKE can automatically download all the caffe package you need, it has a very poor download speed on my computer. I would recommend download the caffe package yourself using a download manager(eg. IDM), unzip them in the directory and leave the zip file in the directory given below(all the packages in red circles need to be downloaded).

Here are the links to download all the packages

CUDACaffe:http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_16_2020_11_14.zip

CPU Caffe: http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_cpu_2018_05_27.zip

Caffe dependencies: http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_16_2020_11_14.zip

OpenCV: http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/opencv_450_v15_2020_11_18.zip

Packages you will need.

When we have installed all the prerequisites, there is another git repository needs to be downloaded called pybind11, it is again another repository that raised ReadTimeoutError when I tried to download them. So I would suggest using transfer station of Github code again to download this package and put it in the directory: “openpose/3rdparty”. After you have done so, try the third command given on the installation guide to make sure you have installed the correct package.

— — — END OF TIPS FOR PEOPLE DOWNLOADING FROM CHINA — — — —

Before getting started, we need to install the latest version CMAKE and Visual Studio(2019 Community), and make sure you tick the box called “C++ for Desktop Development” (the one in the red rectangle).

Then go to command line to open CMAKE in the specific directory(read the DOWNLOADING part if you have trouble downloading models using CMAKE).

Press Configure after downloading then make sure to enable the BUILD_PYTHON flag and alter the GPU_MODE to CPU_ONLY. We will then press “Configure” again, if there is no error, press “Generate” then “Open Project” to open the project using Visual Studio.

Search for python and tick the box
Search for GPU and change the setting to CPU_ONLY

Computer will open Visual Studio 2019 automatically after we press the ‘Open Project’ button.

First, we need to alter from Debug mode to Release mode.

We then need to go to the “Build” menu, and press “Build Solution” . Wait until it is all done, if we can run the python api in the directory: openpose/build/example/tutorial_api_python/01_body_from_image.py, that means we have successfully installed openpose on your computer.

I followed the exact steps the Instruction Guide told to me to do while compiling the project using Visual Studio. The error that causes us a week to found out was with the python version. I was using Python 3.8 to run the python API provided by the module, it constantly throws the error: ‘Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?’. We checked everything including directory and walked through the Installation Guide again and again to find out the steps we missed. It turned out that python 3.8 does not use the way python 3.7 used to import all the dependency packages, it has a different command for that. If you are using python3.8 and could not get the python API working, I would suggest switching from 3.8 to 3.7 which worked for me. Otherwise make sure you have the pyopenpose.xxx.pyd file under “openpose\build\python\openpose\Release”, and it matches your python version. For example cp37 matches python 3.7(usually occurs for Mac OS users).

Thanks for reading!

--

--