Using OpenVINO Model Zoo with OpenCV

In the previous sections, we briefly discussed OpenVINO Model Zoo and how we can use OpenVINO IE with OpenCV. In this section, we will learn more about Model Zoo and what it offers.

OpenVINO Model Zoo is a collection of optimized pre-trained models that can be directly imported into OpenVINO for inference. The importance of this feature lies in the fact that one of the major reasons behind OpenVINO's speedup is the optimized model file that it takes for inference. The underlying inference principle is still the same as most deep learning inference toolkits and languages, such as OpenCV. OpenCV's dnn module uses this speedup principle of OpenVINO by using it as the default backend for all inference tasks.

While it is possible to convert the model files into .xml and .bin files, it's not very easy. There are mainly two problems that you might encounter in this process:

  • OpenVINO might throw an error saying that a particular neural network layer could not be recognized. This error basically means that the original model had a neural network architecture that had one or more layers that OpenVINO is not compatible with and hence it cannot build the optimized .xml and .bin files for the model.
  • OpenVINO is built in a way that it can process most model types (Caffe, ONNX, TensorFlow, and so on) into .xml and .bin files, but that doesn't mean it covers all of the types. You might have a model built in a completely different architecture that might not be compatible with OpenVINO.

These issues help us to understand the importance of a repository of OpenVINO optimized model files that can directly be used by OpenVINO. Model Zoo contains two main kinds of model:

  • The public model set: This consists of models that are provided by the community.
  • The free model set: This consists of models that are prepared by OpenVINO's developer team.

Neither kinds of model are shipped along with the OpenVINO installation because of their huge size; the best way to obtain them is by using the model_downloader script present in the deployment_tools oolsmodel_downloader location inside your OpenVINO installation directory.

Let's now learn how to classify images using OpenCV with OpenVINO Inference Engine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.145