Welcome back to the OpenVINO channel
AI, or specifically for our applications deep learning neural networks, begins with data.
Many people are re-using existing models and re-train them with a different data-set,
and get great results.
Can a neural network that was trained to detect cats, be used to detect dogs??
The answer is YES, this neural network already has the right feature extraction capabilities,
if you now plug in dogs images instead of cats and re-train the network
You may bring the network to a different equilibrium, for dogs detection..
Which is not far for cats detection..
Of course this is just an example..
So, we are supplying many of the neural networks
from the OpenVINO model-zoo with their full training packages..
basically you have the full training environment, all the required scripts and sometimes
even the data we used.
What you can do is plug-in your specific data, and Re-run the training process,
From our experiments, you will get better accuracy.
The angle of the camera, the zoom, the lighting conditions, can sometimes make a difference..
This is a very powerful way to customize the open zoo models to your specific data-set.
I'm going to the OpenVINO training extensions page
First stage is to get the repository..
Once I have it, I install all the prerequisites
Now I have to choose a model
I'm going to run the tensorFlow for LPR "License Plate recognition."
Very important, before you begin, make sure you are in the right directory
It should be training_extensions/ tensorflow_toolkit/lpr
Now we can setup the virtual environment I am going to use my Intel E3 system,
so no external GPU is required
Prepare all the modules and I'm ready for the next step
which is getting the data..
Before we start, make sure that we are in the
right directory
Now we have to be under "data" And we have to download the LPR data-set from the
Open model zoo.
I already have it, So I'm just going to un-tar it..
And split the full data-set into training
and Validation sub sets..
And this is how the data should be structured.
It's Important when you bring your own data, to keep the same hierarchies and formats
We can see the annotation file, basically
a list of all the images and their labels.
We can open one of the images, you can see it here..
And all of them looks the same..
Now we are ready for training.
Make sure you are in the training directory
Let's look into config.py
You can see all the training and evaluating parameters
Make sure that the pointer to the training data is correct
Same for the validation data
You can see here that the batch size is set to 32
Let's do only 250 iterations Let's ask to generate a checkpoint every
10 iterations
And see the results every 10 iterations
I'd like to see the progress in tensorBoard
So in another terminal, I run tensorBoard
Start the training process from scratch
Let's see our progress in the tensorBoard
After one iteration our lose function is at 306
After iteration 11 it drops to 136
You can see that under "model" directory,
I'm getting all the checkpoints saved, after each 10 iterations
After 200 iterations, the lose function is
converging to around 30 Now I have trained from scratch,
But you can follow these instructions to start from any checkpoint you'd like..
Better run these commands one by one not in a bash
Next step is fairly easy, Take the latest checkpoint and convert the
model to OpenVINO for inference..
OK, we have taken the original model with
the original data-set and trained or re-trained from a checkpoint
Now you have to plug in your data-set and do the same.
This is a Chinese data-set, bring your English, Spanish, whatever dataset in, update the links
and re-run training.
Thank you