Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

New 3D human pose estimation demo

Cariaggi__Francesco
5,172 Views

As pointed out in the release notes of the latest version of OpenVINO (2020.1), several new demos were added, including a "3D human pose estimation" demo. Such demo is located at /opt/intel/openvino_2020.1.023/deployment_tools/open_model_zoo/demos/python_demos/human_pose_estimation_3d_demo

When I try to execute the following command:

python3 human_pose_estimation_3d_demo.py -h

I get the following error:

Traceback (most recent call last):
  File "human_pose_estimation_3d_demo.py", line 25, in <module>
    from modules.parse_poses import parse_poses
  File "/opt/intel/openvino_2020.1.023/deployment_tools/open_model_zoo/demos/python_demos/human_pose_estimation_3d_demo/modules/parse_poses.py", line 18, in <module>
    from pose_extractor import extract_poses
ImportError: cannot import name 'extract_poses'

It seems as though a Python module of some sort is missing. How do I solve that?

0 Kudos
1 Solution
JesusE_Intel
Moderator
5,172 Views

Hi Francesco,

You will need to build the Native Python Extension module as stated in the Prerequisites. To Build the extension modules add -DENABLE_PYTHON=ON to the cmake command in the build script.

(cd "$build_dir" && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON "${extra_cmake_opts[@]}" "$DEMOS_PATH")

The build script is located in the /opt/intel/openvino/inference_engine/demos directory. Once you run the script you will need to export the PYTHONPATH as follows:

export PYTHONPATH="$PYTHONPATH:<bin_dir>/lib"

All the detailed steps can be found here:

https://github.com/opencv/open_model_zoo/blob/master/demos/README.md#build-the-demo-applications

Hope this helps!

 

Regards,

Jesus

View solution in original post

0 Kudos
9 Replies
JesusE_Intel
Moderator
5,173 Views

Hi Francesco,

You will need to build the Native Python Extension module as stated in the Prerequisites. To Build the extension modules add -DENABLE_PYTHON=ON to the cmake command in the build script.

(cd "$build_dir" && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON "${extra_cmake_opts[@]}" "$DEMOS_PATH")

The build script is located in the /opt/intel/openvino/inference_engine/demos directory. Once you run the script you will need to export the PYTHONPATH as follows:

export PYTHONPATH="$PYTHONPATH:<bin_dir>/lib"

All the detailed steps can be found here:

https://github.com/opencv/open_model_zoo/blob/master/demos/README.md#build-the-demo-applications

Hope this helps!

 

Regards,

Jesus

0 Kudos
Cariaggi__Francesco
5,171 Views

Thank you very much Jesus!

0 Kudos
azmat
Beginner
5,171 Views

Where exactly is the pre-trained, converted model for this demo?  All I can find is the 2D pose estimation model `human-pose-estimation-0001`.  Thanks.

0 Kudos
JesusE_Intel
Moderator
5,171 Views

Hi Azmat,

You can download the PyTorch model with the Model Downloader tool using the following command:

python3 /opt/intel/openvino/deployment_tools/tools/model_downloader/downloader.py --name human-pose-estimation-3d-0001

Take a look at this thread for additional information on converting the PyTorch model to IR format.

Regards,

Jesus

0 Kudos
Mankala__vageeshan
5,171 Views

Hi jesus !

I have build the Native Python Extension module as stated in the Prerequisites. still the same issue persists

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

 I have checked the files in the pose_extracter there are no python files. I can find a bunch of cpp files only even after the build was successful.

 

0 Kudos
Radhika_Goel
Beginner
3,203 Views

I am using Latest Openvino_2021.4.689 in windows 10 terminal . I am also facing the same issue: 

> python human_pose_estimation_3d_demo.py -m ../../../../../public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.xml -i face-demographics-walking.mp4 -h
Traceback (most recent call last):
File "<path>\OpenVINO Toolkit\openvino_2021.4.689\inference_engine\demos\human_pose_estimation_3d_demo\python\modules\parse_poses.py", line 18, in <module>
from pose_extractor import extract_poses
ImportError: cannot import name 'extract_poses' from 'pose_extractor' (unknown location)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "human_pose_estimation_3d_demo.py", line 25, in <module>
from modules.parse_poses import parse_poses
File "<path>\OpenVINO Toolkit\openvino_2021.4.689\inference_engine\demos\human_pose_estimation_3d_demo\python\modules\parse_poses.py", line 20, in <module>
raise ImportError("Module 'pose_extractor' not found. "
ImportError: Module 'pose_extractor' not found. Please build module according to documentation before usage. 

 

Please rectify this issue soon. Or provide me correct way to resolve this.

Note: I have already build using build_demos_msvc.bat and it was showing successful. I have used

below for converter.py:

  • python openvino_2021.4.689/deployment_tools/open_model_zoo/tools/downloader/converter.py --mo openvino_2021.4.689/deployment_tools/model_optimizer/mo.py --list openvino_2021.4.689/inference_engine/demos/human_pose_estimation_3d_demo/python/models.lst 
  • and following cmd for downloader.py : 
    • python openvino_2021.4.689/deployment_tools/open_model_zoo/tools/downloader/downloader.py --list openvino_2021.4.689/inference_engine/demos/humne 10an_pose_estimation_3d_demo/python/models.lst
  • BOTH WERE SUCCESSFUL
0 Kudos
Vladimir_Dudnik
Employee
3,170 Views

@Radhika_Goel  have you noticed recommendation from @JesusE_Intel  comment to add -DENABLE_PYTHON=ON cmake options when you build the demo? It is not set by default, to not distract customers, who only interested in C++ demo and may not have Python installed at all.

0 Kudos
Radhika_Goel
Beginner
3,138 Views

Hi @Vladimir_Dudnik  I have already noticed that recommendation from @JesusE_Intel  , but I don't get that build scripts i.e open_model_zoo/demos/build_demos.sh with the installation package.

I am trying to highlight in the below SS, the files that I found common with Github directory at this github link: https://github.com/openvinotoolkit/open_model_zoo/tree/master/demos. but there is no such file build_demos.sh

Radhika_Goel_0-1632665951514.png

And I am also not able to find any other such script where I can edit this Suggested cmake cmd.

(cd "$build_dir" && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON "${extra_cmake_opts[@]}" "$DEMOS_PATH")

  Kindly provide me the appropriate suggestion regarding this issue, please tell me if I am missing something. FYI, I am using this in  Windows10 machine.

Thanks.

0 Kudos
Vladimir_Dudnik
Employee
3,114 Views

@Radhika_Goel  I thought it is obvious enough that on Windows you need to look for .BAT files rather then .SH, although that might be not stated clearly enough in Open Mode Zoo Demos documentation. You are not required to modify script or CMakeLists.txt files. Just call it with -DENABLE_PYTHON=ON command line option. For convenience, I've use simple BAT wrapper which set up required environment and call script to build demos, it's contains lines like in example, below

 

 

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
call C:\Miniconda3\condabin\activate py3.7-openvino-2021.4
call "C:\Program Files (x86)\IntelSWTools\openvino_2021.4.689\bin\setupvars.bat"
call c:\dev\DNN\open_model_zoo_fork\demos\build_demos_msvc.bat --target clean
call c:\dev\DNN\open_model_zoo_fork\demos\build_demos_msvc.bat -DENABLE_PYTHON=ON

 

 

You may correct this to match path for your OpenVINO installation. Note, as a prerequisite, I've created virtual Python environment, for OpenVINO 2021.4.1, using openvino-dev PyPi package. It is as simple as:

 

 

python -m pip install openvino-dev[caffe,caffe2,onnx,tensorflow2,pytorch,mxnet]

 

 

 

This will install all required Python dependencies for Model Zoo models conversion. To run Python demos, you may need to install some additional modules, see requirements.txt files in each demo subfolder.

 

Regards,
  Vladimir

0 Kudos
Reply