[CV] OpenVINO installation tutorial

This tutorial is to configure openvino for yolov5s, other networks are for reference only

0. Official installation tutorial and requirements

Official website installation tutorial link https://docs.openvino.ai/cn/latest/openvino_docs_install_guides_installing_openvino_windows.html
Installation requirements:

Among them, python requires 3.6-3.8, you can use anaconda to create a virtual environment to install python3.7

insert image description here

1. Download openvino_toolkit from the official website

Official website download link: https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html
insert image description here
Note that you need to download the 2021 version here. If you have installed the 2020 version, you are using openvino When converting .onnxto IRa file, python mo.py --input_model=best.onnx --output_dir=Myonnx_IR --model_name=yolowheel --scale=255 --data_type=FP16an error similar to the following may appear when executing the command

[ ERROR ]  operands could not be broadcast together with shapes (4,) (0,)
[ ERROR ]
[ ERROR ]  It can happen due to bug in custom shape infer function <function UpsampleOp.upsample_infer at 0x000001BEBC1976A8>.
[ ERROR ]  Or because the node inputs have incorrect values/shapes.
[ ERROR ]  Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ ERROR ]  Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): Stopped shape/value propagation at "Resize_118" node.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.

According to https://www.51sjk.com/b70b281860/ , it is guessed that the 2020 version of openvino does not yet support some operators in yolov5


2. Open the file directly after the download is complete

If there is a flashback problem during the installation process, it is caused by system incompatibility, enable the compatibility mode in the file properties, and then open it again
insert image description here

  • Just keep clicking next to modify the installation path
  • There may be some warnings, just next
    insert image description here
  • The installation is complete
    insert image description here

3. Configure environment variables

Configure the environment variables as shown in the figure below. Note that the path needs to be replaced with your own corresponding installation path.
insert image description here
If the environment variable is prompted to be too long, you can enter the OpenVINO path in the system environment variable according to the content in the above figure. The four paths are separated by semicolons, and then in the system Add %OpenVINO% to the Path in the variable, as shown below
insert image description here

insert image description here

4. Configure Model Optimizer

Enter the directory D:\Program\intel\openvino_2021\deployment_tools\model_optimizer\install_prerequisites(corresponding to your own installation path)
, open cmd, activate the anaconda environment (python3.6-3.8), and execute install_prerequisites.batcommands in cmd to run.
Wait for the installation to complete.

5. Run the demo

Enter the directory D:\Program\intel\openvino_2021\deployment_tools\demo
and run demo_security_barrier_camera.bat in the anaconda environment

Reference:
https://blog.csdn.net/qq_41251963/article/details/121406569
https://blog.csdn.net/m0_57055443/article/details/122747401
YOLOv5 to openvino and deploy
https://blog.csdn. net/gcf_uinque/article/details/105827378
https://blog.csdn.net/weixin_42586726/article/details/125198259

Guess you like

Origin blog.csdn.net/qq_42475234/article/details/126045671