Prev Tutorial: How to schedule your network for Halide backend
Next Tutorial: YOLO DNNs
| |
Original author | Aleksandr Voron |
Compatibility | OpenCV == 4.x |
This tutorial provides OpenCV installation guidelines how to use OpenCV with OpenVINO.
Since 2021.1.1 release OpenVINO does not provide pre-built OpenCV. The change does not affect you if you are using OpenVINO runtime directly or OpenVINO samples: it does not have a strong dependency to OpenCV. However, if you are using Open Model Zoo demos or OpenVINO runtime as OpenCV DNN backend you need to get the OpenCV build.
There are 2 approaches how to get OpenCV:
- Install pre-built OpenCV from another sources: system repositories, pip, conda, homebrew. Generic pre-built OpenCV package may have several limitations:
- OpenCV version may be out-of-date
- OpenCV may not contain G-API module with enabled OpenVINO support (e.g. some OMZ demos use G-API functionality)
- OpenCV may not be optimized for modern hardware (default builds need to cover wide range of hardware)
- OpenCV may not support Intel TBB, Intel Media SDK
- OpenCV DNN module may not use OpenVINO as an inference backend
- Build OpenCV from source code against specific version of OpenVINO. This approach solves the limitations mentioned above.
The instruction how to follow both approaches is provided in OpenCV wiki.
Supported targets
OpenVINO backend (DNN_BACKEND_INFERENCE_ENGINE) supports the following targets:
- DNN_TARGET_CPU: Runs on the CPU, no additional dependencies required.
- DNN_TARGET_OPENCL, DNN_TARGET_OPENCL_FP16: Runs on the iGPU, requires OpenCL drivers. Install intel-opencl-icd on Ubuntu.
- DNN_TARGET_MYRIAD: Runs on Intel® VPU like the Neural Compute Stick, to set up see.
- DNN_TARGET_HDDL: Runs on the Intel® Movidius™ Myriad™ X High Density Deep Learning VPU, for details see.
- DNN_TARGET_FPGA: Runs on Intel® Altera® series FPGAs see.
- DNN_TARGET_NPU: Runs on the integrated Intel® AI Boost processor, requires Linux drivers OR Windows drivers.