Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
653 stars 137 forks source link

Cannot import extract_poses from pose_extractor.pyd #52

Closed nathanRamaNoodles closed 3 years ago

nathanRamaNoodles commented 3 years ago

Hi there! I am using a Windows 10 on an i5 cpu. Python version: 3.6

I successfully compiled my .pyd from python setup.py build_ext. I added the path in my environmental variables to a folder consisting only with the pose_extractor.pyd

But when I run the camera demo, I get an issue:

from pose_extractor import extract_poses
ImportError: cannot import name 'extract_poses'

Any idea why it isn't able to import the name?

Daniil-Osokin commented 3 years ago

Hi! We have tested it with MSVC compiler under Windows. If PYTHONPATH was modified properly, my best guess is that something was not properly executed during build_ext. May be extract_poses is not exported from the library? Anyway, the demo should be able run as is (but with Python post-processing).

nathanRamaNoodles commented 3 years ago

I want the c++ processing for the Python demo since it is faster. How do I modify the PYTHONPATH? Is it an environmental variable in windows? I used Visual Studio 2019 to compile.
Also, where should the .pyd file go?

data
models
pose_extractor
    src
         extract_poses.cpp
         ...
    CMakeLists.txt
    wrapper.cpp
    pose_extractor.pyd  <-- is here alright?
    pose_extractor.lib
scripts
demo.py
Daniil-Osokin commented 3 years ago

Yes, you can check any answer to this question. The structure looks ok, it is expected that you will run demo.py from cmd, something like this should work (not sure \\ or \):

set PYTHONPATH=pose_extractor\\build\\;
python.exe demo.py ...
nathanRamaNoodles commented 3 years ago

Turns out I had to call my openvino's setupvars.bat before running demo.py. I have no idea why.