Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5921 Discussions

Python-demo Error : ModuleNotFoundError: No module named 'models' .etc

Hnnu_liulei
Beginner
1,899 Views

Demo : open_model_zoo/demos/human_pose_estimation_demo/python/human_pose_estimation_demo.py
Openvino version : l_openvino_toolkit_runtime_raspbian_p_2021.2.185
Device : RaspberryPi+Intel NCS2

In the demo, it need import many modules like:
import models
import monitors
from images_capture import open_images_capture
from pipelines import get_user_config, AsyncPipeline
from performance_metrics import PerformanceMetrics
from helpers import resolution

Because there is no human_pose_estimation_demo of python in this openvino install package, I download it in open_model_zoo.
But when I run it in my RaspberryPi, there many errors like: No module named 'models', 'monitors', 'images_capture'.etc. And I can not find these module's file in openvino install package.

I don't know why and which version of openvino install package can be used for the python's demo of human_pose_estimate. Thanks.

Labels (1)
0 Kudos
4 Replies
Peh_Intel
Moderator
1,874 Views

Hi Liu Lei,

 

Thanks for reaching out to us.

 

For your information, the package does not include the Open Model Zoo demo applications.

All the required modules are located in the common folders.

 

You can download them from the Open Models Zoo repository with this command line:

git clone -b 2021.2 https://github.com/openvinotoolkit/open_model_zoo.git 

 

However, you are still unable to run the Human Pose Estimation Python Demo due to nGraph module is not included in the OpenVINO™ Toolkit for Raspbian OS Package. You have to build Open Source OpenVINO™ Toolkit for Raspbian OS in order to import the nGraph module.

 

You can refer to Building Open Source OpenVINO™ toolkit for Raspbian* OS and Intel® Neural Compute Stick 2 for the instructions.

 

Some changes that need to make are:

>Installing OpenCV from source

git clone --depth 1 --branch 4.5.3-openvino https://github.com/opencv/opencv.git

 

>Downloading source code and installing dependencies

git clone --depth 1 https://github.com/openvinotoolkit/openvino.git

 

>Building

pip3 install -r requirements.txt

 

On a separate note, I would recommend you choose Human Pose Estimation C++ Demo which allows you to proceed with your current installed package.

 

The steps for building Human Pose Estimation C++ Demo are given below:

1. source /opt/intel/openvino_2021/bin/setupvars.sh

2. mkdir build && cd build

3. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /<download_dir>/open_model_zoo/demos

4. make -j2 human_pose_estimation_demo

The demo is located in the /build/armv7l/Release directory.

 

 

Regards,

Peh

 

 

Hnnu_liulei
Beginner
1,857 Views

Thank you for your reply.

I found that there is a folder named ngraph in the deployment_tools directory in version of l_openvino_toolkit_runtime_raspbian_p_2021.2.185. Does it mean that ngraph modules can be used in this version?

But when I was running the human_pose_estimation demo, it still prompted that ngraph could not be imported. I don't know why.

If I don't build Open Source OpenVINO™ Toolkit for Raspbian OS now, will this be improved in the later version of l_openvino_toolkit_runtime_raspbian_p so that I can download and use it directly.

Peh_Intel
Moderator
1,829 Views

Hi Liu Lei,

 

The nGraph module does not bind for the Python in Raspbian package.

 

There is no ngraph folder in the Python3.7 folder of the package: <installed_dir>/l_openvino_toolkit_runtime_raspbian_p_2021.2.185/python/python3.7

 

The development team will review the possibility to add this in future OpenVINO releases.

 

Meantime, you can comment out import ngraph for those models that are not using ngraph.

 

For instance, Human Pose Estimation Python Demo supports Intel pre-trained Human Pose Estimation Models (human-pose-estimation-0001,0002,0003 and 0004) in two types of architecture (“ae” - Associative Embedding or “openpose" for OpenPose).

 

Looking into these two architectures, OpenPose includes the nGraph module while Associative Embedding does not include the nGraph module. Hence, you can proceed to run Human Pose Estimation Python Demo by editing the source code of the demo and only use “ae” for the architecture.

 

Changes need to make:

1)     open_model_zoo/demos/python_demos/human_pose_estimation_demo/human_pose_estimation.py

         Line 30: from human_pose_estimation_demo.model import HPEAssociativeEmbedding

 

2)     open_model_zoo/demos/python_demos/human_pose_estimation_demo/human_pose_estimation_demo/model.py

         Line 23: #import ngraph as ng

 

 

Models that supported by Associative Embedding architecture:

i)    human-pose-estimation-0002

ii)   human-pose-estimation-0003

iii)  human-pose-estimation-0004

 

 

 

Regards,

Peh

 

Peh_Intel
Moderator
1,785 Views

Hi Liu Lei,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question. 



Regards,

Peh


Reply