Welcome to the OpenVINO channel
From time to time, there is a new need to
handle a new set of topologies or other capabilities Data Scientist and the people who build and
train neural networks develop new structures and new APIs,
A great example is TensorFlow object detection API.
This is an API built on top of TensorFlow.
It makes it easy to construct, train and deploy object detection models
And it is often used to for very common topologies like SSD, Faster or Mask R-CNN RFCN and more.
We do support all of these topologies with OpenVINO
The problem is that when you are running inference in real time,
The algorithm should be written in an optimal way for the hardware to execute it
Most Hardware we use to accelerate neural networks inference were built to accelerate
direct-acyclic-graphs, Meaning a very structured graph as you can
see here for example..
But when you look at the graph structure of an SSD model for example,
And I'm using here tensorboard for viewing, You can see here the main function of feature-extraction
But also the preprocessor and the post-processor
Getting into the pre-processor You can see that it has a while loop, which
is great if you are programming but not so great if this is a part of a neural network..
Same goes for the post-processor which also
has loops
So what the model-optimizer is doing it to cut loops in the graph and replace them by
higher level layers, that do not have loops If you will look at the same model after model
optimizer, you will not find these loops..
What we need to do is to help the model-optimizer
understand how to replace these portions of the graph
And this is done by 2 more arguments
The first one is "TF use custom operations", And it uses a special JSON file to describe
how to replace loops sub graphs
The second parameter, is a pipeline cofig file
If you have used the model-downloader to download
the model, this file will already be there in the same directory
If not, these files could be found in the tensorflow training environment.
Let's do an example together.
First I will download a model using our model-downloader.
I'm downloading Mobilenet-ssd-V2
And I have the tensorflow files
You can see them all here
And now we are looking for the JSON file,
They are all located here:
Let's look at SSD_V2_Support JSON file
You can see here the instructions on how to handle the pre-processor block for example
and so on..
The second file we need is a pipeline config file And it was already downloaded for us..
You can see here all the models parameters that the MO need for its work
And we are running MO..
This is our model..
This is our JSON file..
SSD_V2 support This is the pipeline config file..
And it's running
You can see here the MO tell us that thePre-Processor
block was removed
And we have the IR files, XML and BIN
Now let's jus make sure the model is working I'm copying the python object detection demo
Lets run it
This is my input video
Im using the converted XML file..
And since this is an SSD model I need the libCPU extension library cell
And it's running
We saw how to convert a tensorFlow object
detection model,
Subscribe to our channel to get more videos like this one.
Thank you