Let's run Openpose on Windows 10 using Python It seems that the Python API can be used with OpenPose, so I tried it
Please note that the explanations written in the introductory explanations and tutorials are omitted.
For the time being, the official explanation is given in the tutorial below, but I will explain it because it did not go well according to the procedure. https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/modules/python_module.md#introduction
https://github.com/CMU-Perceptual-Computing-Lab/openpose.git Clone
openpose/3rdparty I think there is a folder called pybind11 inside, but I think it's empty That folder https://github.com/pybind/pybind11.git Let's replace it with a cloned one
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md
Follow the Installation section here to finish before the Open Pose Building Please proceed firmly so that there are no mistakes I used the Cmake GUI as in the tutorial ** The important thing is to check BUILD_PYTHON on the way ** (Unchecked by default)
Next, start OpenPose.sln in the completed openpose / build folder in Visual Studio. I used Visual Studio 2017 (I use the one set in CMake)
Here is one caveat For the official tutorial
CMake-GUI alternative (recommended): Open the Visual Studio solution (Windows), called build/OpenPose.sln. Then, set the configuration from Debug to Release and press the green triangle icon (alternatively press F5).
It says, but this wasn't enough to use the Python API. (Only minimal builds were done to get OpenPose working)
So, in the toolbar above Visual Studio Build-Build the solution Select to build.
At this time, let's build in Release mode
After the build is finished openpose\build\python\openpose\Release Please Confirm.
pyopenpose.cp37-win_amd64.pyd pyopenpose.exp pyopenpose.lib
I think that has been generated. (The file name may be slightly different depending on the environment. If there is no Release folder in the first place, what is wrong.)
This time,
pyopenpose.cp37-win_amd64.pyd
Cp37 shows that it is for python 3.7. If I try to load this with another python version, it probably won't load (I was really into it here)
So
You need to do either. (I didn't know the method of 2, so if you can understand it, please let me know in the comments.)
openpose\build\examples\tutorial_api_python
Go to and run the sample file as appropriate (01_body_from_image.py etc.)
At this time, numpy and opencv-python are required Also be aware of the Python version, as mentioned in the previous step
If all goes well, the posture estimation result with the sample image will be displayed as shown below.
I would like to add a method to read pyopenpose other than this directory later.
Recommended Posts