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.
6506 Discussions

Python Demo - Missing OpenCV Post-OpenVINO installation? (Mac OSX 10.15.5)

raymondlo84
New Contributor I
3,768 Views

During the OpenVINO installation I see the OpenCV was selected as part of the installation, but did it setup the packages for the Python? I try to do simple, import cv2 with python3 and it's not working, so how can I run the demo scripts as they all have the same dependencies?

I did run the setupvar.sh before running the Python.

Is there a tutorial on how to run those Python demos? This is not showing me the setup and so? 

===

raylo@Raymonds-MacBook-Pro human_pose_estimation_3d_demo % ls

README.md                        human_pose_estimation_3d_demo.py modules                          requirements.txt

data                             models.lst                       pose_extractor

raylo@Raymonds-MacBook-Pro human_pose_estimation_3d_demo % python3 human_pose_estimation_3d_demo.py

Traceback (most recent call last):

  File "human_pose_estimation_3d_demo.py", line 20, in <module>

    import cv2

ModuleNotFoundError: No module named 'cv2'

=====

=====

https://docs.openvinotoolkit.org/latest/omz_demos_human_pose_estimation_demo_README.html

=====

raylo@Raymonds-MacBook-Pro deployment_tools % ls

demo             inference_engine intel_models     model_optimizer  ngraph           open_model_zoo   tools

raylo@Raymonds-MacBook-Pro deployment_tools % python3

Python 3.8.2 (default, Aug 10 2020, 05:49:21)

[Clang 12.0.0 (clang-1200.0.31.1)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import cv2

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'cv2'

0 Kudos
1 Solution
IntelSupport
Community Manager
3,740 Views

Hi Raymond,

 

That happens because OpenCV is not installed. It seems you have Python 3.8.2 installed. Refer this link for OpenVINO installation: https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_macos.html

 

Follow the installation steps and make sure you meet the system requirement needed.


Software Requirements:


Cmake 3.9 or higher

Python 3.5 - 3.7

Apple Xcode* Command Line Tools

(Optional) Apple Xcode* IDE(not required for OpenVINO, but useful for development

 

Best Regards,

Aznie


View solution in original post

0 Kudos
5 Replies
raymondlo84
New Contributor I
3,758 Views

And here we go for some logs.

raylo@Raymonds-MacBook-Pro ~ % uname -ar
Darwin Raymonds-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
raylo@Raymonds-MacBook-Pro ~ % which python3
/usr/bin/python3
raylo@Raymonds-MacBook-Pro ~ % python3 --version
Python 3.8.2
raylo@Raymonds-MacBook-Pro ~ % pip3 freeze
absl-py==0.10.0
astunparse==1.6.3
attrs==20.2.0
cachetools==4.1.1
certifi==2020.6.20
chardet==3.0.4
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
flake8==3.8.3
flake8-import-order==0.18.1
gast==0.3.3
google-auth==1.21.2
google-auth-oauthlib==0.4.1
google-pasta==0.2.0
graphviz==0.8.4
grpcio==1.32.0
h5py==2.10.0
idna==2.10
iniconfig==1.0.1
joblib==0.16.0
Keras-Preprocessing==1.1.2
kiwisolver==1.2.0
Markdown==3.2.2
matplotlib==3.3.2
mccabe==0.6.1
more-itertools==8.5.0
motmetrics==1.2.0
mxnet==1.7.0.post1
networkx==2.5
nibabel==3.1.1
numpy==1.19.2
oauthlib==3.1.0
onnx==1.7.0
opt-einsum==3.3.0
packaging==20.4
pandas==1.1.2
Pillow==7.2.0
pluggy==0.13.1
protobuf==3.13.0
py==1.9.0
py-cpuinfo==7.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.6.0
pyflakes==2.2.0
pyparsing==2.4.7
pytest==6.0.2
pytest-benchmark==3.2.3
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.3.1
requests==2.24.0
requests-oauthlib==1.3.0
rsa==4.6
scikit-learn==0.23.2
scipy==1.4.1
six==1.15.0
tensorboard==2.3.0
tensorboard-plugin-wit==1.7.0
tensorboardX==2.1
tensorflow==2.3.0
tensorflow-estimator==2.3.0
termcolor==1.1.0
test-generator==0.1.1
threadpoolctl==2.1.0
toml==0.10.1
tqdm==4.49.0
typing-extensions==3.7.4.3
urllib3==1.25.10
Werkzeug==1.0.1
wrapt==1.12.1
xmltodict==0.12.0

 

 

0 Kudos
IntelSupport
Community Manager
3,741 Views

Hi Raymond,

 

That happens because OpenCV is not installed. It seems you have Python 3.8.2 installed. Refer this link for OpenVINO installation: https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_macos.html

 

Follow the installation steps and make sure you meet the system requirement needed.


Software Requirements:


Cmake 3.9 or higher

Python 3.5 - 3.7

Apple Xcode* Command Line Tools

(Optional) Apple Xcode* IDE(not required for OpenVINO, but useful for development

 

Best Regards,

Aznie


0 Kudos
raymondlo84
New Contributor I
3,736 Views

Thank you for the reply. Yes, I checked and the Python 3.8 is the root cause of many of these issues. Oddly as I didn't get any warnings from the installation from the dependency check. Instead, the Python 3.8 was installed automatically by the openvino toolkit installer (FYI my machine was brand new and Python was never installed).


However, is there any instructions on how to run the code in the python_demo folder? I ran human_pose_estimation_3d_demo, and it seems the pose_extractor is missing?

Thank you! 

0 Kudos
raymondlo84
New Contributor I
3,726 Views

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

Ok, I found it. So the build flag for python + setting path was not very clear to me at all.  I am glad this was discussed already however. (I'm not alone kinda feeling). 

 

-ray

0 Kudos
IntelSupport
Community Manager
3,714 Views

Hi Raymond,


This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.


Regards,

Aznie


0 Kudos
Reply