1
00:00:00,150 --> 00:00:00,610
Hi, guys.

2
00:00:00,630 --> 00:00:03,100
Welcome back to Lesson 43.

3
00:00:03,150 --> 00:00:10,980
We will take a look at creating a mass detector using the TensorFlow object, detects a library and

4
00:00:10,980 --> 00:00:13,710
we're going to train a mobile net SSD.

5
00:00:13,830 --> 00:00:16,590
Remember SSD single shot detectors?

6
00:00:16,800 --> 00:00:18,690
So let's take a look at this lesson.

7
00:00:19,260 --> 00:00:26,190
So again, just want to reiterate that these notebooks have been adapted from Ramon Flow.

8
00:00:26,760 --> 00:00:29,790
Oh, it's mostly the same notebook, however I do.

9
00:00:29,790 --> 00:00:35,130
I do often have to make a couple of little changes here, and these are the credits who actually for

10
00:00:35,130 --> 00:00:40,320
the guys who actually created this full notebook because these things are actually pretty tricky to

11
00:00:40,320 --> 00:00:45,300
create in a club environment requires a lot of custom configuration.

12
00:00:45,300 --> 00:00:48,270
But once it works, it's I mean, that works.

13
00:00:48,810 --> 00:00:56,310
It doesn't work forever, though sometimes club can have some updates that do tend to break these up

14
00:00:56,310 --> 00:00:58,410
to connect to scripts, unfortunately.

15
00:00:59,130 --> 00:01:01,680
So I've already run a lot of these blocks of code.

16
00:01:01,680 --> 00:01:03,750
Here you can see it takes zero seconds to run.

17
00:01:03,750 --> 00:01:07,980
This is just simply some configuration and some variables were defining.

18
00:01:08,580 --> 00:01:16,650
Then we have to select TensorFlow Vision 1.0 because the TensorFlow 2.0 doesn't support the object detection

19
00:01:16,650 --> 00:01:17,700
API just yet.

20
00:01:18,120 --> 00:01:19,860
It might be supported, actually.

21
00:01:19,860 --> 00:01:21,730
Actually, it is what it is right now, I believe.

22
00:01:21,750 --> 00:01:27,630
However, let's just keep it at TensorFlow 1.0 here because everything in this notebook works and it

23
00:01:27,630 --> 00:01:33,210
should continue to work once it's in TensorFlow one point x thing, it's one point one for that call

24
00:01:33,210 --> 00:01:37,980
up ships with when you set it to this vision, I do, actually.

25
00:01:37,980 --> 00:01:44,430
I have trained recently an efficient detect model using TensorFlow Object Detection API in TensorFlow

26
00:01:44,430 --> 00:01:45,520
two point four.

27
00:01:45,520 --> 00:01:51,630
I believe it's 2.6 right now, but I don't think it would actually do the work in 2.6 if I remember

28
00:01:51,630 --> 00:01:52,290
correctly now.

29
00:01:52,860 --> 00:01:55,410
So anyway, sorry for rambling.

30
00:01:55,890 --> 00:02:03,030
So what we do know we run the report, the TensorFlow object detection repo here, and this is from

31
00:02:03,030 --> 00:02:05,820
the URL that we set previously up here.

32
00:02:07,230 --> 00:02:09,900
And so let's just pull and tortoise repo.

33
00:02:10,440 --> 00:02:12,490
Then we install the required packages.

34
00:02:12,510 --> 00:02:18,180
This might take about a minute to forty nine seconds on my club, so roughly the same on yours.

35
00:02:19,050 --> 00:02:21,810
Then we just navigate to the directory.

36
00:02:22,170 --> 00:02:25,500
We get data sets and placed them in the correct place.

37
00:02:26,130 --> 00:02:32,640
Then we just make sure all of TensorFlow actually has to have two files for the records it has for the

38
00:02:32,640 --> 00:02:33,900
dataset annotations.

39
00:02:34,500 --> 00:02:41,310
There's the PB text file, as well as a t.f record file, so we just make sure those on the right directories.

40
00:02:41,910 --> 00:02:48,150
Then these are the we have data to record names from a sell them, sell them or not to send it to our

41
00:02:48,150 --> 00:02:51,480
files so we can have these pointing to the correct directories here.

42
00:02:51,510 --> 00:02:53,750
This is the CoLab Library part.

43
00:02:53,760 --> 00:02:57,240
If you were running this in your local system, you would need to change this.

44
00:02:57,750 --> 00:03:01,620
We shouldn't be too much of a big change as we remove the content part of it.

45
00:03:02,880 --> 00:03:06,960
Next, we download the pre-trained model.

46
00:03:06,990 --> 00:03:08,250
That's a base model here.

47
00:03:08,790 --> 00:03:09,900
So we get that.

48
00:03:10,050 --> 00:03:13,140
And then we just we just run some tests there.

49
00:03:13,770 --> 00:03:16,920
We just check the model checkpoint directory as well.

50
00:03:17,400 --> 00:03:19,590
Now we start configuring our pipeline.

51
00:03:19,680 --> 00:03:24,600
As you can see, as I mentioned before, there's a lot of things that are quite confusing because it's

52
00:03:24,600 --> 00:03:29,640
more, I guess you could say, software development, software engineering style stuff that goes on

53
00:03:30,180 --> 00:03:32,970
in configuration configuring these notebooks.

54
00:03:33,120 --> 00:03:35,430
But nevertheless, it's not that hard to follow.

55
00:03:36,300 --> 00:03:41,370
So we just set we create a function to get the number of classes from the PB text file.

56
00:03:42,090 --> 00:03:44,800
Then we or what else do we do?

57
00:03:44,850 --> 00:03:48,040
We just set up our training pipeline here.

58
00:03:48,060 --> 00:03:54,300
We have two parts being set here as well, so we can create all those files if we need to.

59
00:03:55,110 --> 00:04:00,210
And then we just check the pipeline name here, which is all the settings that will be training.

60
00:04:00,630 --> 00:04:04,410
This model would take all its configuration so you can see this.

61
00:04:04,580 --> 00:04:05,190
This is a way.

62
00:04:05,190 --> 00:04:10,470
It can check everything to make sure because it's going to pass this file when you start training here

63
00:04:10,470 --> 00:04:12,030
and look at all these settings.

64
00:04:13,140 --> 00:04:15,090
Next, we can run the tests of what optional?

65
00:04:15,930 --> 00:04:21,870
Not sure if it's working because they know and grok, which is what we used in Split did make some updates

66
00:04:21,870 --> 00:04:24,570
that prevented it from being used easily and cooler.

67
00:04:24,690 --> 00:04:31,740
Although in the later lessons with the web app and web and API rest API, I do show you how to fix that.

68
00:04:31,950 --> 00:04:33,810
So for now, maybe this works.

69
00:04:33,810 --> 00:04:34,560
Let's check it out.

70
00:04:36,600 --> 00:04:40,060
There doesn't seem like it's working downward downward.

71
00:04:40,080 --> 00:04:41,070
It's some support.

72
00:04:41,070 --> 00:04:43,680
But actually, that's not even the end brookvale.

73
00:04:43,680 --> 00:04:44,100
Sorry.

74
00:04:45,270 --> 00:04:46,530
That's just the install file.

75
00:04:47,970 --> 00:04:48,370
Yeah.

76
00:04:48,390 --> 00:04:54,030
So no, we're training the model and you can see this is our training results as we go.

77
00:04:54,060 --> 00:04:59,580
You can see it doesn't give us all of the nice map and lost stats that we would we would want to see

78
00:04:59,580 --> 00:04:59,810
all of.

79
00:04:59,860 --> 00:05:05,860
We do have an overall score here, although I'm not sure which locks it is, but nevertheless it is

80
00:05:06,340 --> 00:05:14,140
a metric we can use to monitor, and you can see that gives us a time per well, looks like every 100

81
00:05:14,140 --> 00:05:14,810
steps.

82
00:05:14,840 --> 00:05:18,340
Not sure if that's what the e-book settings are here.

83
00:05:18,460 --> 00:05:20,020
We probably could go up and check.

84
00:05:20,680 --> 00:05:22,780
But nevertheless, it is training.

85
00:05:22,780 --> 00:05:28,810
And I remember, if I remember correctly, this model doesn't actually take that long to print, which

86
00:05:28,810 --> 00:05:32,520
is pretty good because it's a mobile SSD.

87
00:05:32,950 --> 00:05:38,680
It's quite quite a lightweight model, and it gives a very good performance, especially if you convert

88
00:05:38,680 --> 00:05:40,300
it to flight model.

89
00:05:40,930 --> 00:05:47,020
You can get 10 to 20 frames a second on modern Android phones with this model, which is quite good

90
00:05:47,050 --> 00:05:53,200
because that was something that maybe five years ago required like a desktop GPU to get that kind of

91
00:05:53,200 --> 00:05:53,830
performance.

92
00:05:54,370 --> 00:05:57,740
So, no, we can just check the performance metrics here.

93
00:05:57,760 --> 00:06:00,190
You can download a Model five if you wanted to.

94
00:06:01,660 --> 00:06:08,920
Yeah, we don't actually display actually, as we do, we do display the inference and some test images

95
00:06:08,920 --> 00:06:11,080
here, which we will see shortly.

96
00:06:11,080 --> 00:06:12,700
This is all a set up here.

97
00:06:12,910 --> 00:06:17,680
So I'm not going to go through that could run before I should run after a few.

98
00:06:18,070 --> 00:06:22,360
If it doesn't run properly, just message me and I can look into the bug.

99
00:06:22,870 --> 00:06:24,700
But now you can see it's looking quite good.

100
00:06:24,820 --> 00:06:27,940
You can even get to God this guy's gas miss, which is a bit extreme.

101
00:06:28,900 --> 00:06:30,790
So all of these must be detected.

102
00:06:30,800 --> 00:06:32,650
This one isn't two, and this one isn't.

103
00:06:33,070 --> 00:06:36,970
So you can see it does have some issues with some black mass.

104
00:06:37,810 --> 00:06:40,690
However, it's getting most of the mask here, and this is a remember.

105
00:06:40,810 --> 00:06:45,430
I should say this is a lightweight model, so we could probably lower the confidence threshold if you

106
00:06:45,430 --> 00:06:47,800
wanted to detect more mass.

107
00:06:47,800 --> 00:06:51,940
But remember, you probably get some false positives at that point.

108
00:06:53,360 --> 00:06:54,820
But you can see it's looking pretty good.

109
00:06:55,700 --> 00:07:03,700
Not sure why this blood tests this blood one is that they just think it's a mistake, but you can see

110
00:07:03,700 --> 00:07:04,650
it's looking quite good.

111
00:07:04,660 --> 00:07:05,470
Quite interesting.

112
00:07:06,250 --> 00:07:08,380
OK, so that's it for this lesson.

113
00:07:08,380 --> 00:07:13,840
In the next lesson lesson 44, we'll take a look at a sign language detection, and we're going to use

114
00:07:13,840 --> 00:07:15,670
the same TensorFlow API setup.

115
00:07:16,420 --> 00:07:22,030
However, the principal object detector API setup, but hub of a hover, we're going to train the fish

116
00:07:22,030 --> 00:07:26,470
and detect model, which gives better performance than the mobile SSD.

117
00:07:26,920 --> 00:07:27,250
OK.

118
00:07:27,550 --> 00:07:28,910
So stay tuned for that lesson.

119
00:07:28,990 --> 00:07:29,410
Thank you.
