1
00:00:02,000 --> 00:00:03,000
Hello everyone.

2
00:00:03,000 --> 00:00:09,000
In this video tutorial we will see how we can train your V8 model for helmet detection and segmentation.

3
00:00:09,000 --> 00:00:15,000
So this is going to be a complete end to end tutorial, so don't skip any part of the video and do watch

4
00:00:15,000 --> 00:00:16,000
the complete video.

5
00:00:16,000 --> 00:00:23,000
So for this project I will be using this helmet images dataset available publicly on roboflow.

6
00:00:23,000 --> 00:00:30,000
So the dataset consists of around 272 training images and that 24 testing images, the validation set

7
00:00:30,000 --> 00:00:31,000
images are not there.

8
00:00:31,000 --> 00:00:36,000
So in this project we will consider the test images as the validation images.

9
00:00:36,000 --> 00:00:41,000
So okay, so we will adjust it when we download this dataset into the Google CoLab notebook.

10
00:00:42,000 --> 00:00:42,000
Okay.

11
00:00:42,000 --> 00:00:43,000
So.

12
00:00:44,000 --> 00:00:49,000
We have around to 72 images for the training and 24 images for the testing set, which we will consider

13
00:00:49,000 --> 00:00:51,000
for the validation purpose.

14
00:00:52,000 --> 00:00:52,000
Okay.

15
00:00:52,000 --> 00:00:58,000
So if we see the dataset over here, so the dataset consist of only one class which is of helmet and

16
00:00:58,000 --> 00:01:04,000
no other classes are there and the images consists of the helmet the person is wearing while riding

17
00:01:04,000 --> 00:01:08,000
the bicycle and the handmade the person wears when while riding a motorbike.

18
00:01:08,000 --> 00:01:16,000
Okay, so you can see over here the person is wearing a helmet while riding a motorcycle or by riding

19
00:01:16,000 --> 00:01:21,000
a bicycle while on the other hand, the person is wearing a helmet while riding the bike.

20
00:01:21,000 --> 00:01:29,000
So we have the images of the persons wearing helmet while riding the motorcycle or by riding the bicycle.

21
00:01:29,000 --> 00:01:35,000
Okay, So you can see that the person is driving the car and he is wearing a helmet here as well.

22
00:01:35,000 --> 00:01:37,000
So the dataset is very fine.

23
00:01:37,000 --> 00:01:44,000
So now in order to export this dataset into our Google CoLab notebook, I will go to the dataset and

24
00:01:44,000 --> 00:01:50,000
click on download and just click on show download folder right here and click on Continue.

25
00:01:52,000 --> 00:01:58,000
So, for example, if you don't have an account or roboflow, you need to create an account Roboflow

26
00:01:58,000 --> 00:02:00,000
by clicking, going to sign up.

27
00:02:00,000 --> 00:02:06,000
So I've already have the account on Roboflow So I have just signed in and I can now export the dataset

28
00:02:06,000 --> 00:02:09,000
from Roboflow into my Google CoLab notebook.

29
00:02:09,000 --> 00:02:15,000
So just copy this command from here, like the Jupyter Kumar and you just need to paste this command

30
00:02:15,000 --> 00:02:21,000
into the your Google CoLab notebook so that this dataset can be exported into your Google CoLab notebook.

31
00:02:21,000 --> 00:02:22,000
Okay.

32
00:02:22,000 --> 00:02:25,000
So here in the first step, we will import all the required libraries.

33
00:02:25,000 --> 00:02:28,000
So here in the first we are importing the library.

34
00:02:28,000 --> 00:02:35,000
A library in this project helps us to navigate between different files of the project.

35
00:02:35,000 --> 00:02:40,000
Then we have the Globe Library to display any output predictions on test images.

36
00:02:40,000 --> 00:02:47,000
So we need the Globe Library so that we can display the predictions of the or output images into the

37
00:02:47,000 --> 00:02:48,000
Google CoLab notebook.

38
00:02:49,000 --> 00:02:55,000
Then, if you want to display any input, image or any output image, we need the image library so that

39
00:02:55,000 --> 00:02:59,000
we can display a single image into the Google CoLab notebook.

40
00:02:59,000 --> 00:03:04,000
Okay, so in the first step, we need to check whether we have the access to GPU or not.

41
00:03:04,000 --> 00:03:11,000
To check the access, I will just run this cell so you can see that GPU memory usage.

42
00:03:11,000 --> 00:03:16,000
So please make sure before running the script that you have selected the runtime as GPU.

43
00:03:16,000 --> 00:03:20,000
Okay, so you can just run this cell again.

44
00:03:20,000 --> 00:03:21,000
Okay.

45
00:03:21,000 --> 00:03:24,000
So YOLO, it can be implemented in two ways.

46
00:03:24,000 --> 00:03:26,000
Like one is the PIP install method.

47
00:03:26,000 --> 00:03:28,000
So this is the basically the first iteration of YOLO.

48
00:03:28,000 --> 00:03:32,000
V eight is the first iteration of YOLO to have an official package.

49
00:03:32,000 --> 00:03:32,000
Okay.

50
00:03:32,000 --> 00:03:36,000
So YOLO V8 can be implemented by installing.

51
00:03:36,000 --> 00:03:42,000
You can directly install the package which is PIP install and critics which will install the V8 or if

52
00:03:42,000 --> 00:03:43,000
you want to for the development.

53
00:03:43,000 --> 00:03:48,000
If you want to make some changes in the training script or prediction or validation, for example,

54
00:03:48,000 --> 00:03:55,000
you want to add the tracking or if tracking or if you want to do the vehicle counting or the speed estimation,

55
00:03:55,000 --> 00:03:56,000
then you can.

56
00:03:56,000 --> 00:03:59,000
You need to clone the GitHub repo of the Ultralytics.

57
00:03:59,000 --> 00:03:59,000
Okay.

58
00:03:59,000 --> 00:04:05,000
So although I'm not doing any such making any change in the training but addition of prediction, but

59
00:04:05,000 --> 00:04:10,000
I would be in this project, I will be cloning the GitHub repo by the easy ways.

60
00:04:10,000 --> 00:04:14,000
You can simply install the package which is PIP, install ultralytics and run the command line interface.

61
00:04:15,000 --> 00:04:20,000
But in this project I'm just learning the alternative hip hop rap over here.

62
00:04:20,000 --> 00:04:25,000
So here I've just fought the rapper into my GitHub account, so it's here.

63
00:04:25,000 --> 00:04:30,000
You can see my name on 197 for the for this alternative repo.

64
00:04:31,000 --> 00:04:36,000
So just just run this wrapper so that the repo will be cloned over here.

65
00:04:36,000 --> 00:04:38,000
Now you can see that.

66
00:04:38,000 --> 00:04:38,000
Okay.

67
00:04:38,000 --> 00:04:40,000
Just cancel this.

68
00:04:40,000 --> 00:04:41,000
I will just.

69
00:04:41,000 --> 00:04:42,000
So now you can see this.

70
00:04:43,000 --> 00:04:43,000
See this?

71
00:04:43,000 --> 00:04:47,000
Now we have the ultralytics here, the V8 over here.

72
00:04:47,000 --> 00:04:50,000
So now we need to just set the current directory as this folder.

73
00:04:50,000 --> 00:04:51,000
So just run this cell.

74
00:04:51,000 --> 00:04:55,000
So now this cloned folder is set to our current directory.

75
00:04:55,000 --> 00:05:01,000
Now we need to install all the required libraries or the dependencies to run this project.

76
00:05:01,000 --> 00:05:07,000
So if you skip this step, so if you run the training validation or prediction step, you will face

77
00:05:07,000 --> 00:05:10,000
the issue that the libraries, some of the libraries will not be installed.

78
00:05:10,000 --> 00:05:15,000
So you will face the issue that hydro libraries Seaborn library, Matplotlib libraries not installed.

79
00:05:15,000 --> 00:05:21,000
So it's better to install all the dependencies before running the training validation prediction step

80
00:05:21,000 --> 00:05:23,000
so that you don't face this issue.

81
00:05:23,000 --> 00:05:28,000
While at that time you will have to install the each of the libraries separately like PIP install Seaborn.

82
00:05:28,000 --> 00:05:35,000
So by running the dependencies, by installing the dependencies, this will install all the required

83
00:05:35,000 --> 00:05:36,000
libraries to run this script.

84
00:05:36,000 --> 00:05:44,000
So we need to check whether ultra V8 is imported and it's working fine so we can see that we have done

85
00:05:44,000 --> 00:05:47,000
the icon import ultralytics and predict checks.

86
00:05:47,000 --> 00:05:52,000
So you can see that the ultra text or the V8 has been installed and it's working fine.

87
00:05:52,000 --> 00:05:53,000
Okay.

88
00:05:53,000 --> 00:05:57,000
So now we need to import the helmet segmentation dataset from the roboflow.

89
00:05:57,000 --> 00:06:03,000
So we are just setting our directory as segmentation so you can see that Ultralytics Yolo.

90
00:06:03,000 --> 00:06:07,000
Then we go to V8, then we go to segment.

91
00:06:07,000 --> 00:06:13,000
So as we are doing segmentation in this project, so we just copy the path and set our current directory

92
00:06:13,000 --> 00:06:16,000
as this segmentation folder.

93
00:06:16,000 --> 00:06:16,000
Okay.

94
00:06:16,000 --> 00:06:20,000
So now we will install the dataset from the roboflow.

95
00:06:20,000 --> 00:06:27,000
So just go over here and just copy this command, which I have done so and just paste this command over

96
00:06:27,000 --> 00:06:28,000
here just like this.

97
00:06:28,000 --> 00:06:31,000
Control a and just paste this command over here.

98
00:06:31,000 --> 00:06:33,000
Now just run this cell.

99
00:06:33,000 --> 00:06:38,000
So it will download the dataset from roboflow into this segment folder.

100
00:06:39,000 --> 00:06:45,000
Okay, so it might take few seconds, so let's wait and see, but the dataset will be downloaded into

101
00:06:45,000 --> 00:06:51,000
your segmentation folder so we can see that the dataset is started to download.

102
00:06:51,000 --> 00:06:56,000
It's, it will download in the zip format then, but it will automatically unzip it as well.

103
00:06:56,000 --> 00:06:59,000
Like you can see that it's downloading in the zip format.

104
00:06:59,000 --> 00:07:02,000
So it's 89, 88, 100% done.

105
00:07:02,000 --> 00:07:07,000
So now we can see the dataset over here, helmet dataset.

106
00:07:07,000 --> 00:07:11,000
Okay, so now we will train the V8 model on this dataset.

107
00:07:11,000 --> 00:07:18,000
So just make sure you need to just make things one thing ahead, like please dash to remove and open

108
00:07:18,000 --> 00:07:21,000
the data dot yml and just.

109
00:07:22,000 --> 00:07:26,000
Okay, you just go over here and click on.

110
00:07:26,000 --> 00:07:26,000
Okay.

111
00:07:26,000 --> 00:07:27,000
So just.

112
00:07:28,000 --> 00:07:35,000
Go over here and open the data dot yml file and just set the training and validation images path so

113
00:07:35,000 --> 00:07:37,000
we don't have the testing images.

114
00:07:37,000 --> 00:07:38,000
So we will.

115
00:07:38,000 --> 00:07:39,000
Okay.

116
00:07:39,000 --> 00:07:43,000
So we have the testing images, but we don't have the validation set images which we have seen there

117
00:07:43,000 --> 00:07:44,000
as well.

118
00:07:44,000 --> 00:07:49,000
Like you can see over here, our data set does not contain the validation set images.

119
00:07:49,000 --> 00:07:52,000
It contains the training and testing set images.

120
00:07:52,000 --> 00:07:57,000
But in this project we will consider the testing, set images as the validation set images.

121
00:07:57,000 --> 00:08:03,000
So simply remove the test images and just rename this test folder as.

122
00:08:05,000 --> 00:08:06,000
That edition for the.

123
00:08:06,000 --> 00:08:07,000
Okay.

124
00:08:07,000 --> 00:08:13,000
So just click on this now and just copy this path and just.

125
00:08:14,000 --> 00:08:15,000
Is spot were here.

126
00:08:15,000 --> 00:08:20,000
And in the validation case, now we have renamed this folder as the validation folder.

127
00:08:20,000 --> 00:08:21,000
So just go over here.

128
00:08:21,000 --> 00:08:28,000
Copy path and just paste this path over here and control S So now the training and validation paths

129
00:08:28,000 --> 00:08:35,000
have been set because we have removed the testing, change the testing to validation because we need

130
00:08:35,000 --> 00:08:41,000
the validation for image, we need some images in the validation folder so that we can validate our

131
00:08:41,000 --> 00:08:41,000
model.

132
00:08:41,000 --> 00:08:45,000
And plus, while training, we also need some validation images.

133
00:08:45,000 --> 00:08:46,000
Okay.

134
00:08:46,000 --> 00:08:50,000
So to validate our model on some or test images.

135
00:08:50,000 --> 00:08:52,000
So we have just converted a.

136
00:08:53,000 --> 00:08:57,000
Training images are testing images to of validation.

137
00:08:57,000 --> 00:09:00,000
Okay so it's appearing from dot detect dot train.

138
00:09:00,000 --> 00:09:02,000
So let me fix this issue.

139
00:09:02,000 --> 00:09:09,000
So I will just go to I think there is an update in the ultralytics, so I will just go to ultralytics,

140
00:09:09,000 --> 00:09:09,000
YOLO V8.

141
00:09:10,000 --> 00:09:15,000
So and then Ultralytics YOLO V8 is under high development, so if there are any change occur.

142
00:09:15,000 --> 00:09:18,000
So we are sometimes face this issue.

143
00:09:18,000 --> 00:09:26,000
So I will just go to YOLO V8 segment and I will go to train.py.

144
00:09:27,000 --> 00:09:32,000
So as the alternative is under the development, so sometimes the packages get updated and we face this

145
00:09:32,000 --> 00:09:32,000
issue.

146
00:09:32,000 --> 00:09:42,000
So just copy this from here, Ctrl c and just go to the train.py script and just add this over here.

147
00:09:42,000 --> 00:09:49,000
So just go to over here and just Ctrl v, ctrl s and just now run this trip now.

148
00:09:50,000 --> 00:09:50,000
Okay.

149
00:09:52,000 --> 00:09:54,000
So where we were.

150
00:09:54,000 --> 00:09:55,000
So where you are here.

151
00:09:55,000 --> 00:09:57,000
So just now run this trip.

152
00:09:57,000 --> 00:10:00,000
So we are going to train our model on 80 epochs.

153
00:10:00,000 --> 00:10:02,000
Let's see if there is any error so we can fix it.

154
00:10:02,000 --> 00:10:06,000
If it starts working fine, then we will wait for that training to complete.

155
00:10:07,000 --> 00:10:07,000
Okay.

156
00:10:08,000 --> 00:10:15,000
So that is first of all, it is rolling downloading the the Pre-trained model, which is trained with

157
00:10:15,000 --> 00:10:16,000
the Coco dataset.

158
00:10:16,000 --> 00:10:16,000
Okay.

159
00:10:16,000 --> 00:10:19,000
File not found has helmet to data dot yml.

160
00:10:20,000 --> 00:10:20,000
Okay.

161
00:10:20,000 --> 00:10:23,000
What is our dataset provocation.

162
00:10:23,000 --> 00:10:23,000
Okay.

163
00:10:23,000 --> 00:10:25,000
Just means set this.

164
00:10:25,000 --> 00:10:26,000
Just give me a minute now.

165
00:10:26,000 --> 00:10:27,000
It will be working fine.

166
00:10:28,000 --> 00:10:28,000
Okay.

167
00:10:28,000 --> 00:10:34,000
Now just run this because I missed these two cells, so that's why this error was appearing.

168
00:10:34,000 --> 00:10:36,000
But I hope it will work fine.

169
00:10:36,000 --> 00:10:38,000
So now the training is going to start.

170
00:10:38,000 --> 00:10:44,000
So the training might take a 30 to 40 minutes because the dataset is not very large.

171
00:10:44,000 --> 00:10:45,000
So the training to complete.

172
00:10:45,000 --> 00:10:51,000
So I will pause the video as the training gets start and as the training complete, I will be back.

173
00:10:51,000 --> 00:10:58,000
So the training is about to start and let that start from the first epoch so that I can pause the video

174
00:10:58,000 --> 00:11:00,000
and that the training updates.

175
00:11:00,000 --> 00:11:01,000
I will be back.

176
00:11:01,000 --> 00:11:03,000
So it's around.

177
00:11:03,000 --> 00:11:06,000
Okay, training has started, but it will take some time.

178
00:11:06,000 --> 00:11:07,000
So the ASR training completes.

179
00:11:07,000 --> 00:11:12,000
I will be back and then we will see the results and test our model on some demo videos.

180
00:11:15,000 --> 00:11:20,000
Well, guys, the training of the model is complete on helmet dataset for the segmentation.

181
00:11:20,000 --> 00:11:25,000
We have trained our model on 80 epochs and we have set the image size.

182
00:11:25,000 --> 00:11:27,000
614 So here are the results.

183
00:11:27,000 --> 00:11:30,000
You can see that the model is trained on eight epochs.

184
00:11:30,000 --> 00:11:39,000
So at the start we have a mean average precision with 50 at 0.5661 and the mean average precision with

185
00:11:39,000 --> 00:11:42,000
1595 is 0.431.

186
00:11:42,000 --> 00:11:48,000
But as the training progresses, we can see that the mean average precision begins to improve for both

187
00:11:48,000 --> 00:11:51,000
the 50 and 50 to 95.

188
00:11:51,000 --> 00:11:58,000
So in last we have mean average precision with IOU 50 as 0.58 and with mean average precision with iron,

189
00:11:59,000 --> 00:12:06,000
50 to 95 is 0.462 and we have the best weights of the model saved as well.

190
00:12:06,000 --> 00:12:11,000
And the last weight loss is the model weights on the last epoch, which is 80th epoch.

191
00:12:12,000 --> 00:12:12,000
Okay.

192
00:12:12,000 --> 00:12:15,000
So here is the model summary as well.

193
00:12:15,000 --> 00:12:20,000
And you can see that we have only one class, which is the heavyweight class, and we have a mean average

194
00:12:20,000 --> 00:12:29,000
precision with 50 as 0.674 and mean average precision with 50 to 95 is 0.548.

195
00:12:29,000 --> 00:12:31,000
So these results are good.

196
00:12:31,000 --> 00:12:33,000
Like these are not the bad results.

197
00:12:33,000 --> 00:12:34,000
These are very fine results.

198
00:12:34,000 --> 00:12:38,000
Okay, so our results are saved in run segment, train port.

199
00:12:38,000 --> 00:12:41,000
So let me show you where our results are saved.

200
00:12:42,000 --> 00:12:43,000
So keyboard to YOLO.

201
00:12:44,000 --> 00:12:48,000
Then we click on V8 and then we go to segment and in the run.

202
00:12:50,000 --> 00:12:52,000
Rain bullets got here in this border.

203
00:12:52,000 --> 00:12:56,000
We have the weights file which contains the best and last weights.

204
00:12:56,000 --> 00:13:01,000
And here are the confusion matrix for the predictions on the validation batch.

205
00:13:01,000 --> 00:13:04,000
So let us see what different files we have over here.

206
00:13:04,000 --> 00:13:05,000
So.

207
00:13:06,000 --> 00:13:06,000
For this.

208
00:13:06,000 --> 00:13:12,000
We will check what different files we have over here so you can see that we have the confusion matrix

209
00:13:12,000 --> 00:13:14,000
master F1 curve.

210
00:13:15,000 --> 00:13:22,000
We have the reserve store CSV file which contains the model performance or the performance on each of

211
00:13:22,000 --> 00:13:24,000
each epoch and dessert store.

212
00:13:24,000 --> 00:13:27,000
Contain the training and validation losses and validation.

213
00:13:27,000 --> 00:13:31,000
Batch prediction contain the model predictions on the validation batch.

214
00:13:31,000 --> 00:13:34,000
So the validation images are not used for the training.

215
00:13:34,000 --> 00:13:41,000
So it always better to see what model or model predicts on the validation batch and the grids file contain

216
00:13:41,000 --> 00:13:43,000
the best and last weights.

217
00:13:43,000 --> 00:13:46,000
Okay, so next, let's see the confusion matrix.

218
00:13:46,000 --> 00:13:50,000
So confusion matrix basically shows how our model handles different plastic.

219
00:13:50,000 --> 00:13:53,000
But in this case, we have only one class, which is a pyramid.

220
00:13:53,000 --> 00:14:00,000
So from the confusion matrix, we can see that 92% of time our model detected correctly that the person

221
00:14:00,000 --> 00:14:06,000
is wearing a helmet, while 8% time when the person is wearing the helmet.

222
00:14:06,000 --> 00:14:09,000
The model was unable to detect that the person is wearing the helmet.

223
00:14:11,000 --> 00:14:13,000
Now here we have the training and validation losses.

224
00:14:14,000 --> 00:14:19,000
So you can see that the training and validation loss begins to decrease as the training progresses.

225
00:14:19,000 --> 00:14:26,000
While so this means that currently we have trained our model for 18 epochs.

226
00:14:26,000 --> 00:14:33,000
So if we train our model for 350 to 400 epochs, we can definitely say that the loss will further decrease

227
00:14:33,000 --> 00:14:36,000
and the mean average precision will further improve.

228
00:14:36,000 --> 00:14:38,000
Like you can see that the mean average precision is increasing.

229
00:14:39,000 --> 00:14:43,000
Okay, so here are the model predictions on the validation batch.

230
00:14:43,000 --> 00:14:45,000
So the results are very good.

231
00:14:45,000 --> 00:14:49,000
Like model was able to predict correctly the bicycle helmet.

232
00:14:49,000 --> 00:14:53,000
You can see over here that the person wearing the bicycle is wearing the helmet.

233
00:14:54,000 --> 00:14:57,000
So and the person riding the motorbike is also leading the handbrake.

234
00:14:57,000 --> 00:15:02,000
So the model was able to detect correctly the helmet on the validation.

235
00:15:02,000 --> 00:15:05,000
So these are the model predictions on the validation batch.

236
00:15:05,000 --> 00:15:09,000
So validation batch is not used for the all the validation images are not used for the training.

237
00:15:10,000 --> 00:15:14,000
So it's always better to have a look and see how the model performs.

238
00:15:14,000 --> 00:15:19,000
Okay, so now here we are validating the system model on validation dataset images.

239
00:15:19,000 --> 00:15:26,000
So there are 24 images and on which we are validating the model and the model results which we obtain

240
00:15:26,000 --> 00:15:35,000
a mean average precision with 50 0.69 and mean average precision with 50 to 95 with 0.562.

241
00:15:36,000 --> 00:15:42,000
Okay, so let's test our model on a demo video and see how our model performs.

242
00:15:42,000 --> 00:15:47,000
So I have just downloaded a demo video from Pixels and paste into my drive and I'm just downloading

243
00:15:47,000 --> 00:15:49,000
the demo video directly from my drive.

244
00:15:49,000 --> 00:15:53,000
And now I will test the model on this demo video.

245
00:15:55,000 --> 00:15:59,000
Okay, so just done this and now checking the current directory.

246
00:15:59,000 --> 00:16:03,000
And now let's test our model on this demo video.

247
00:16:06,000 --> 00:16:07,000
It might take two seconds.

248
00:16:08,000 --> 00:16:11,000
Open a model to run on this demo video.

249
00:16:11,000 --> 00:16:18,000
Like you can see that their model has divided a complete video into 1462 frames, and it's processing

250
00:16:18,000 --> 00:16:20,000
each of the frame one by one.

251
00:16:20,000 --> 00:16:25,000
So if and we can see the predictions that the model is rejecting the helmet as well.

252
00:16:25,000 --> 00:16:31,000
So as this process completes and let me display the demo video in the Google CoLab, then I will be

253
00:16:31,000 --> 00:16:32,000
back for ten.

254
00:16:32,000 --> 00:16:33,000
Then I'm just pausing the video.

255
00:16:34,000 --> 00:16:36,000
So that model.

256
00:16:37,000 --> 00:16:40,000
So the model has possessed the demo video which we have passed as an input.

257
00:16:40,000 --> 00:16:46,000
And here I have displayed the demo video over here and let's see what results do we get.

258
00:16:46,000 --> 00:16:52,000
So it's a just 15 second so we can see that the model is able to detect the helmet.

259
00:16:52,000 --> 00:16:58,000
But let me download this demo video and let's play it and show you the results live as well.

260
00:16:59,000 --> 00:17:00,000
So just give me a second.

261
00:17:00,000 --> 00:17:04,000
The video downloaded, okay, So the video is downloaded.

262
00:17:04,000 --> 00:17:05,000
Let me just play it.

263
00:17:06,000 --> 00:17:08,000
Electing to shift my strain towards it.

264
00:17:08,000 --> 00:17:09,000
So.

265
00:17:10,000 --> 00:17:13,000
You can see that the model is able to detect the helmet successfully.

266
00:17:13,000 --> 00:17:18,000
The border of DICOM has a disabled model of detecting the helmet.

267
00:17:18,000 --> 00:17:20,000
Okay, so the reserves are fine.

268
00:17:20,000 --> 00:17:26,000
Next test our model on some other demo videos and see what results do we get over there.

269
00:17:26,000 --> 00:17:29,000
We're just going back to the One Laptop by now.

270
00:17:30,000 --> 00:17:32,000
Let's test the model on some more demo videos.

271
00:17:33,000 --> 00:17:35,000
So here is the demo video too.

272
00:17:35,000 --> 00:17:39,000
So let me download it from the drive and test the model on this demo video.

273
00:17:43,000 --> 00:17:45,000
Well, now I will test the model on the demo video too.

274
00:17:45,000 --> 00:17:49,000
So I will download the demo video directly from the drive.

275
00:17:49,000 --> 00:17:55,000
I have placed the demo video on the drive, so I am just downloading it and now I will run the prediction

276
00:17:55,000 --> 00:18:00,000
script on this demo video and see what results do we get here.

277
00:18:00,000 --> 00:18:04,000
I have passed the model best weights and here is the source in the source.

278
00:18:04,000 --> 00:18:11,000
I have passed the video on which I want to test the model so the predictions will be done frame by frame.

279
00:18:11,000 --> 00:18:16,000
So it might take some time for the prediction to process each of the frame.

280
00:18:16,000 --> 00:18:17,000
So it has started.

281
00:18:18,000 --> 00:18:19,000
So the model.

282
00:18:19,000 --> 00:18:22,000
So we have won 70 frames from this video.

283
00:18:22,000 --> 00:18:24,000
So what is the process?

284
00:18:24,000 --> 00:18:28,000
Each of the frame and we can see the prediction that one has made two helmet.

285
00:18:28,000 --> 00:18:30,000
So it may might take some time.

286
00:18:30,000 --> 00:18:32,000
So I will pause the video.

287
00:18:32,000 --> 00:18:38,000
And as the video is ready to display on the Google CoLab notebook, I will just resume the video.

288
00:18:38,000 --> 00:18:38,000
Okay.

289
00:18:41,000 --> 00:18:43,000
Against the spirit has run successfully.

290
00:18:43,000 --> 00:18:47,000
And here is our output video in the Google CoLab notebook.

291
00:18:47,000 --> 00:18:50,000
So let me play this output demo video.

292
00:18:50,000 --> 00:18:56,000
Okay, so you can see that the model is able to detect the helmet and we have done segmentation as well.

293
00:18:56,000 --> 00:18:58,000
The mask you can see as well.

294
00:18:58,000 --> 00:19:02,000
Let me download this video and let's play this video.

295
00:19:02,000 --> 00:19:03,000
So it might take few seconds.

296
00:19:03,000 --> 00:19:04,000
Okay.

297
00:19:04,000 --> 00:19:06,000
Let me now play this video.

298
00:19:07,000 --> 00:19:07,000
Okay.

299
00:19:07,000 --> 00:19:08,000
So.

300
00:19:10,000 --> 00:19:13,000
Just opening the video over here.

301
00:19:13,000 --> 00:19:15,000
Just give me a minute so I can shift my screen.

302
00:19:17,000 --> 00:19:22,000
Okay, so just let me share you this output demo.

303
00:19:22,000 --> 00:19:29,000
So here you can see that the model is able to detect the helmet as well as we have the mask segmentation

304
00:19:29,000 --> 00:19:30,000
as well.

305
00:19:30,000 --> 00:19:36,000
Okay, so let's test our model on a demo video three and let's validate our results on the demo video.

306
00:19:36,000 --> 00:19:37,000
Three.

307
00:19:41,000 --> 00:19:44,000
So now we're testing our model on the demo video three.

308
00:19:44,000 --> 00:19:48,000
So I will directly download this video from the Google Drive into the notebook.

309
00:19:48,000 --> 00:19:52,000
So actually a place the videos on the drive so when I ever need it.

310
00:19:52,000 --> 00:19:55,000
So I directly download into the Google CoLab notebook.

311
00:19:55,000 --> 00:20:00,000
So the name of the video of demo video three is Bike to dot mp4.

312
00:20:00,000 --> 00:20:04,000
So let me just run the script on this demo video.

313
00:20:04,000 --> 00:20:11,000
So I'm running the prediction.py script where by passing the model best weights over here and on the

314
00:20:11,000 --> 00:20:13,000
source is the bike to dot mp4.

315
00:20:13,000 --> 00:20:16,000
So the video might take some time to process.

316
00:20:16,000 --> 00:20:20,000
So as the output is ready to display on the Google colab notebook, I will be back.

317
00:20:20,000 --> 00:20:25,000
So just stopping over here and I will back as the video is ready.

318
00:20:28,000 --> 00:20:29,000
Well, guys, here are our results.

319
00:20:29,000 --> 00:20:30,000
You can see that.

320
00:20:30,000 --> 00:20:36,000
Let me download this video and show you the results and then we can see what results do we get.

321
00:20:36,000 --> 00:20:42,000
So I'm just downloading the video and let me open it as well as it downloads complete.

322
00:20:42,000 --> 00:20:46,000
So just opening it now and just let me shift the screen towards it.

323
00:20:46,000 --> 00:20:49,000
So just give me a few minutes.

324
00:20:49,000 --> 00:20:52,000
And so now you can see the screen.

325
00:20:52,000 --> 00:20:54,000
So here are our results.

326
00:20:54,000 --> 00:21:00,000
You can see that our model was able to detect successfully the helmet and you can see the mask segmentation

327
00:21:00,000 --> 00:21:01,000
of the helmet as well.

328
00:21:01,000 --> 00:21:02,000
Okay.

329
00:21:02,000 --> 00:21:06,000
So the model is working very good and the results are very fine as well.

330
00:21:06,000 --> 00:21:08,000
So that's all from this video tutorial.

331
00:21:08,000 --> 00:21:11,000
See you all in the next video tutorial with some new projects.

332
00:21:11,000 --> 00:21:13,000
Till then, bye bye.

