Documenting the steps that worked for me, for people who also stumbles upon this in the future
This guide is for Windows only
My Own Environment
OS: Windows 11
Python: Python 3.10.10
Usage: Launch via Python Virtual Environment
> venv\scripts\activate
> python demo.py ...
OpenCV
You need to first install all the Python requirements
pip install -r requirements.txt
Then when you run
python setup.py build_ext
It should throw an error saying OpenCV is not found.
If so, go to the offical GitHub and download the .exe for Windows.
After running it, it should extract a opencv folder to the specified path.
Next, open pose_extractor/CMakeLists.txt and add a line above the find_package line for OpenCV, pointing to the build folder that contains the OpenCVConfig.cmake file. Now it should for example look like this:
Now comes the part that caused the most problems for many people.
You can remove the try-except block to see the exact errors thrown when trying to load the fast pose_extractor
When you run the script, it should throw an error saying that the module was not found. This is because the built .pyd file is not found in the path.
And since I'm launching the Python script directly, I cannot do
This does basically the same thing, adding the build folder to the Python path.
You would think it could run correctly now.
But for me, it now throws a different error, saying something like DLL not found, meaning the .pyd file is missing its dependency.
To solve this, open modules/parse_poses.py again, and add a line that points to the OpenCV .dlls:
import os
os.add_dll_directory(r'C:\Program Files\opencv\build\x64\vc16\bin')
The above 4 lines should all be above the from pose_extractor import extract_poses line
Now, it should finally run the fast pose_extractor correctly on Windows~
Documenting the steps that worked for me, for people who also stumbles upon this in the future
My Own Environment
OpenCV
You need to first install all the Python requirements
Then when you run
It should throw an error saying
OpenCV
is not found.If so, go to the offical GitHub and download the
.exe
for Windows. After running it, it should extract aopencv
folder to the specified path.Next, open
pose_extractor/CMakeLists.txt
and add a line above thefind_package
line for OpenCV, pointing to the build folder that contains theOpenCVConfig.cmake
file. Now it should for example look like this:The build should then finish correctly.
Python Path
Now comes the part that caused the most problems for many people.
When you run the script, it should throw an error saying that the module was not found. This is because the built
.pyd
file is not found in the path. And since I'm launching the Python script directly, I cannot doTo solve this, open
modules/parse_poses.py
, and add the following:This does basically the same thing, adding the build folder to the Python path.
You would think it could run correctly now. But for me, it now throws a different error, saying something like
DLL
not found, meaning the.pyd
file is missing its dependency.To solve this, open
modules/parse_poses.py
again, and add a line that points to the OpenCV.dll
s:Now, it should finally run the fast
pose_extractor
correctly on Windows~