1
00:00:00,330 --> 00:00:08,730
Hi and welcome back in this section will be a training that Matterport carries TensorFlow model on the

2
00:00:08,730 --> 00:00:09,660
sheep's dataset.

3
00:00:09,810 --> 00:00:12,360
So we're going to create our own mask, our CNN.

4
00:00:12,900 --> 00:00:14,400
So let's get started.

5
00:00:14,460 --> 00:00:22,140
So open notebook 57, we just come back to it here just so you guys can see the system we're opening

6
00:00:22,140 --> 00:00:22,450
here.

7
00:00:23,340 --> 00:00:24,750
So let's begin the lesson.

8
00:00:24,960 --> 00:00:27,840
So firstly, we have to install our required packages.

9
00:00:27,850 --> 00:00:33,600
This sticks maybe a couple of minutes and you do have to restart the notebook at the end here.

10
00:00:33,600 --> 00:00:34,890
So we start to run time.

11
00:00:35,790 --> 00:00:42,720
Then we need to basically get the new vision of sort of all the vision of each five pay and install

12
00:00:43,080 --> 00:00:51,720
specific vision of Keros and then set the TensorFlow back end to be 1.2 X, which I think it's one four.

13
00:00:52,380 --> 00:00:58,800
And then we need to clone the Matterport mask or CNN repo and then navigate into the shapes directly.

14
00:01:00,180 --> 00:01:05,760
And what we'll do, we'll just untangle the ship's dataset as well.

15
00:01:05,790 --> 00:01:09,150
But for now, we just have all of our inputs here.

16
00:01:09,780 --> 00:01:11,470
We set our class.

17
00:01:11,490 --> 00:01:14,040
This is where we untangled basically the ship's data set.

18
00:01:14,040 --> 00:01:17,010
So it just basically sets all these parameters for it here.

19
00:01:17,640 --> 00:01:24,990
And then actually, this is the model config sorry, not the model config for the ship's dataset model

20
00:01:24,990 --> 00:01:26,070
that we'll be creating.

21
00:01:27,150 --> 00:01:34,860
And then we just set some network preferences functions to return the subplots of the predictions.

22
00:01:35,490 --> 00:01:39,630
And this is where we actually process the ship's data sets.

23
00:01:39,650 --> 00:01:47,220
We can see we have these three classes here, Square Circle Triangle, and then we just have the processes

24
00:01:47,220 --> 00:01:53,310
where we load images where we just do different things, load the mass draw, different shapes, random

25
00:01:53,310 --> 00:01:56,250
shapes, random images generating.

26
00:01:56,280 --> 00:02:02,880
So it's a pretty comprehensive set of functions here that allow us to interact with the ship's dataset.

27
00:02:03,810 --> 00:02:06,000
So now we can just start treating the dataset.

28
00:02:06,100 --> 00:02:12,060
So but before we do, let's just take a look at the data so the bits here and visualize some of the

29
00:02:12,060 --> 00:02:15,480
samples in it so you can see the shapes are pretty basic.

30
00:02:15,490 --> 00:02:16,950
It is an artificial dataset.

31
00:02:16,950 --> 00:02:21,690
It looks like it's on from naturally occurring ships in the real world or in the world.

32
00:02:22,380 --> 00:02:28,230
So you can see they're just random ships and raise it here, and we're creating a mass RC and CNN to

33
00:02:28,230 --> 00:02:29,220
detect these ships.

34
00:02:29,400 --> 00:02:33,310
So let's create a model here, as we have done previously.

35
00:02:33,930 --> 00:02:35,840
And no, we go.

36
00:02:35,850 --> 00:02:36,790
We're going to pre-treated.

37
00:02:36,960 --> 00:02:43,770
Sorry, we're going to use a pre trained model to apply and then use transmit the concept of transmitting

38
00:02:43,770 --> 00:02:45,930
to treat it on our ships dataset.

39
00:02:45,930 --> 00:02:52,140
So we're going to be loading the cookout dataset here and with all the weights here.

40
00:02:52,920 --> 00:03:01,830
And then we just inference on the last model that we have trained and know we can actually start treating.

41
00:03:02,280 --> 00:03:05,760
It prints out a lot of different warnings here, but just ignore them.

42
00:03:05,830 --> 00:03:12,420
However, it does prevent you from visualizing the epochs quite well, so maybe you can connect to attend

43
00:03:12,480 --> 00:03:13,890
a board and visualize them better.

44
00:03:14,520 --> 00:03:19,080
You can see at the end of one epoch because I mean, you can train it for more epochs of this.

45
00:03:19,140 --> 00:03:23,490
This is more of an illustrative lesson on how you would train a model like this.

46
00:03:23,940 --> 00:03:29,820
All the processes and code you need can see the different losses here, so it is a bounding box losses,

47
00:03:29,820 --> 00:03:36,420
mask loss, class loss which is classified, by the way, on validation.

48
00:03:36,420 --> 00:03:40,220
And this is to RPN and predictions as well.

49
00:03:40,230 --> 00:03:42,330
So this is pretty good, a pretty comprehensive.

50
00:03:43,080 --> 00:03:50,070
So now let's run some detections, so we have to look at the model and load below the weights that we

51
00:03:50,070 --> 00:03:51,210
just trained on it.

52
00:03:51,690 --> 00:03:55,020
And now we're going to look at a random test image here.

53
00:03:55,020 --> 00:04:01,920
So let's just get a random image from the datasets that we've created and you can see visualizing it

54
00:04:01,920 --> 00:04:04,020
with the labels onto the images.

55
00:04:04,020 --> 00:04:12,360
You can see the bounding box to label the Circle Square Circle and then basically the mask ship as well.

56
00:04:12,880 --> 00:04:14,430
That's the image segmentation.

57
00:04:15,220 --> 00:04:21,690
Next, you can just run that model to detect the original random image that we loaded displayed the

58
00:04:21,690 --> 00:04:24,020
instances overlaid onto it.

59
00:04:24,030 --> 00:04:27,990
And you can see after one epoch, it looks fairly low.

60
00:04:28,050 --> 00:04:29,400
It got the signal straight.

61
00:04:29,550 --> 00:04:30,990
Didn't get the square.

62
00:04:31,740 --> 00:04:32,660
However, that's OK.

63
00:04:34,080 --> 00:04:37,860
You can see it actually is living quite a bit after one epoch and two minutes of training.

64
00:04:38,490 --> 00:04:46,110
So you can imagine that treating it more than a bigger dataset would improve its accuracy quite a bit.

65
00:04:46,740 --> 00:04:49,590
So that's it for NASCAR.

66
00:04:49,620 --> 00:04:53,520
CNN's image segmentation hope these lessons were useful.

67
00:04:53,520 --> 00:04:59,820
In the next section, we'll take a look at using deep sort, which is a truck, a very useful tool.

68
00:04:59,850 --> 00:05:06,140
Tracking algorithm in conjunction with an object detector such as yours, so stay tuned for that lesson.

69
00:05:06,320 --> 00:05:06,710
Thank you.
