One of having fun with OpenVINO: compilation of cpp samples and demo

Starting today, I decided to leave a memory for the latest version of OpenVINO and write a series of OpenVINO usage.

Originally I wanted to write a source code analysis, but after reading the Optimizer code, I felt that it should be avoided. I don’t plan to write it in detail for the time being. The main reason is that the amount of code is larger than these frameworks such as pytorch/mxnet, and each module The relationship is complicated and cannot be explained in a long time.

I don’t know where I can write it, but I have had some experience before, and because I don’t have time to write too specific tutorials, I can only use some entry-level ones when I look back and use them every time I deploy. Record what you arrive.

I won’t say much about how to install OpenVINO. Download it, just setup, and the environment prerequisite installation. You can read the original text here:

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

Simple command line compilation

One note is that it is best to install it on the C drive , which is related to some reference files in the project. If it is not installed on the C drive, you must manually modify the reference location (I have changed the previous version several times) . Of course, if you want to follow the method of setting the address and then compiling in cmake-gui provided by me, it doesn't matter where it is installed, because the absolute address is set before compiling.

I used the simplest way to compile samples before, as follows

(base) C:\Users\space>conda activate mx36

(mx36) C:\Users\space>cd C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\inference_engine\samples\cpp

(mx36) C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\inference_engine\samples\cpp>build_samples_msvc.bat VS2019
[setupvars.bat] OpenVINO environment initialized
Searching Visual Studio 2019...
Creating Visual Studio 16 2019 x64 files in C:\Users\space\Documents\Intel\OpenVINO\inference_engine_cpp_samples_build...
-- The C compiler identification is MSVC 19.24.28316.0
-- The CXX compiler identification is MSVC 19.24.28316.0
-- Check for working C compiler: 
......

If your environment configuration is normal, this usually ends normally and generates a series of projects.

Cmake-gui编译OpenVINO samples

The next thing to talk about is to use cmake-gui to do this. Among them, I have talked about OpenCV430 here,

https://blog.csdn.net/tanmx219/article/details/106928732

In short, it is the directory that can provide the file OpenCVConfig.cmake that you compile by yourself. Other directories are similar. For details, please refer to the picture.

Why use cmake-gui? Because it is convenient and intuitive.

Compile this way, basically pass once, without suspense, as follows

 

Compilation of Open_Model_Zoo

There is also a demo in the open model zoo provided by OpenVINO, similar to the above, just use cmake-gui to compile it.

Again, there is a build_demos_msvc.bat file under the demos folder. If you want to use the command line to generate the default configuration, these folders are finally placed on the C drive.

If you use cmak-gui as shown below, it doesn’t matter where you put it, we just enter the absolute address as follows,

Afterword

Intel's things are basically similar in style, easy to get started and difficult to master, and the configuration is very good, but they are similar to OpenCV in use, and they need to be very familiar.

 

Guess you like

Origin blog.csdn.net/tanmx219/article/details/107183259