Hi, I'm Priyanka from Intel.
In this video, we go all over the Model Optimizer,
which is a model converter included in the Openvino
Toolkit.
We cover how it converts models, and discuss
important optimization techniques that
are used during conversion.
First off, let's discuss the learning application
deployment.
With the traditional methods, you
take pre-trained deep learning models
as input to the computer vision application,
and input each input frame from the video or image.
The application deployment slightly
changes with the Openvino Toolkit,
as you need to do one-time pre-trained model conversion
using Model Optimizer.
Then you pass the intermediate representation
files to the inference engine to infer input frames.
So keeping this slight change in mind,
let's go into more details of the Model Optimizer
functionality.
Model Optimizer it's a cross-platform command line
online tool that takes pre-trained deep learning
models from frameworks such as Caffe, TensorFlow, or MXNet,
and optimizes them for performance and space using
conservative topologic transformations.
It performs static model analysis and access deep
learning models for optimal execution on endpoint target
devices.
Model Optimizer is written in Python,
and supports a wide range of deep learning
topologics such as AlexNet, GoogleNet, ResNet assistance.
Now let's look at the techniques used by Model Optimizer
for model conversion.
It takes the input model topologic graph,
and during conversion it uses techniques
such as horizontal fusing, dropping unused layers, fully
shipped with convolution, in addition to many others.
It also supports quantization to convert from fb32 to fb16.
Default quantization is fb32.
Model Optimizer fuses different layers of the topologic graphs
to reduce the number of function calls.
When you look in the input model topologic
and the converted model topologic,
you can see that some of the layers are fused.
For example, fusing relu layer with the convolution layer
is relatively easy, as it has only one if statement.
This process in lines the code of your fusing operations
and avoids overloading additional layers.
This leads to better performance without changing
any mathematics in the code or making any logical code
changes in the model.
Now I'm going to show you how to use
Model Optimizer with some input parameters you can set.
For this example, we will show you
how to convert a Caffe model.
First, we will need to run mo underscore
Caffe.py file from the Model Optimizer folder.
Let's run that command with Help option.
You can see that Model Optimizer takes many parameters,
such as input model, output location, floating point
quantization, mean, or scale values.
Run the Model Optimizer, to convert the public SqueezeNet
Caffe model for the classification sample.
I'm running mo underscore Caffe.python
file with the input as SqueezeNet.CaffeModel file,
and output directly as my home folder.
At the end of the execution of Model Optimizer command,
it shows the ir files that originated
with the xml and bin extension.
You can see these files in Output directly.
The Caffe model file gets converted to xml files,
and the prototxt file gets converted to bin file.
The default quantization for Model Optimizer is fb32.
However, you can change that with the data
type FLAGGED to fb60.
The Caffe model isn't the only supported framework
for Model Optimizer.
You can also convert TensorFlow and MXNet models
to intermediate formats to be used by the inference engine.
Thanks for watching.
The next video in the series will
cover how to use this intermediate representation
models from the Model Optimizer with the inference engine
in order to deploy application on different platforms.