Hi and welcome back in this section will be a training that Matterport carries TensorFlow model on the
sheep's dataset.
So we're going to create our own mask, our CNN.
So let's get started.
So open notebook 57, we just come back to it here just so you guys can see the system we're opening
here.
So let's begin the lesson.
So firstly, we have to install our required packages.
This sticks maybe a couple of minutes and you do have to restart the notebook at the end here.
So we start to run time.
Then we need to basically get the new vision of sort of all the vision of each five pay and install
specific vision of Keros and then set the TensorFlow back end to be 1.2 X, which I think it's one four.
And then we need to clone the Matterport mask or CNN repo and then navigate into the shapes directly.
And what we'll do, we'll just untangle the ship's dataset as well.
But for now, we just have all of our inputs here.
We set our class.
This is where we untangled basically the ship's data set.
So it just basically sets all these parameters for it here.
And then actually, this is the model config sorry, not the model config for the ship's dataset model
that we'll be creating.
And then we just set some network preferences functions to return the subplots of the predictions.
And this is where we actually process the ship's data sets.
We can see we have these three classes here, Square Circle Triangle, and then we just have the processes
where we load images where we just do different things, load the mass draw, different shapes, random
shapes, random images generating.
So it's a pretty comprehensive set of functions here that allow us to interact with the ship's dataset.
So now we can just start treating the dataset.
So but before we do, let's just take a look at the data so the bits here and visualize some of the
samples in it so you can see the shapes are pretty basic.
It is an artificial dataset.
It looks like it's on from naturally occurring ships in the real world or in the world.
So you can see they're just random ships and raise it here, and we're creating a mass RC and CNN to
detect these ships.
So let's create a model here, as we have done previously.
And no, we go.
We're going to pre-treated.
Sorry, we're going to use a pre trained model to apply and then use transmit the concept of transmitting
to treat it on our ships dataset.
So we're going to be loading the cookout dataset here and with all the weights here.
And then we just inference on the last model that we have trained and know we can actually start treating.
It prints out a lot of different warnings here, but just ignore them.
However, it does prevent you from visualizing the epochs quite well, so maybe you can connect to attend
a board and visualize them better.
You can see at the end of one epoch because I mean, you can train it for more epochs of this.
This is more of an illustrative lesson on how you would train a model like this.
All the processes and code you need can see the different losses here, so it is a bounding box losses,
mask loss, class loss which is classified, by the way, on validation.
And this is to RPN and predictions as well.
So this is pretty good, a pretty comprehensive.
So now let's run some detections, so we have to look at the model and load below the weights that we
just trained on it.
And now we're going to look at a random test image here.
So let's just get a random image from the datasets that we've created and you can see visualizing it
with the labels onto the images.
You can see the bounding box to label the Circle Square Circle and then basically the mask ship as well.
That's the image segmentation.
Next, you can just run that model to detect the original random image that we loaded displayed the
instances overlaid onto it.
And you can see after one epoch, it looks fairly low.
It got the signal straight.
Didn't get the square.
However, that's OK.
You can see it actually is living quite a bit after one epoch and two minutes of training.
So you can imagine that treating it more than a bigger dataset would improve its accuracy quite a bit.
So that's it for NASCAR.
CNN's image segmentation hope these lessons were useful.
In the next section, we'll take a look at using deep sort, which is a truck, a very useful tool.
Tracking algorithm in conjunction with an object detector such as yours, so stay tuned for that lesson.
Thank you.