1
00:00:02,000 --> 00:00:06,000
The first step and the most important step, which is data gathering.

2
00:00:06,000 --> 00:00:08,000
So we need to gather the images of potholes.

3
00:00:08,000 --> 00:00:15,000
Then we need to annotate those images and then we will train our YOLO segmentation model on those pothole

4
00:00:15,000 --> 00:00:16,000
images.

5
00:00:16,000 --> 00:00:22,000
So our trained YOLO segmentation model can detect the potholes from the images or the videos.

6
00:00:22,000 --> 00:00:29,000
So in order to gather the potholes images, we have found those this image dataset on Kaggle.

7
00:00:29,000 --> 00:00:34,000
So this dataset contains multiple potholes images which you can see on your screen currently.

8
00:00:34,000 --> 00:00:40,000
So we have around the 618 potholes images in this dataset.

9
00:00:40,000 --> 00:00:42,000
So I will just download this dataset.

10
00:00:42,000 --> 00:00:45,000
To download the dataset you need to have an account on Kaggle.

11
00:00:45,000 --> 00:00:51,000
So I have created an account so you can create your account on Kaggle as well and download these images

12
00:00:51,000 --> 00:00:52,000
from Kaggle.

13
00:00:52,000 --> 00:00:54,000
So this is the pothole images dataset.

14
00:00:54,000 --> 00:01:00,000
So in the first step I will download these images, then I will annotate these images to annotate the

15
00:01:00,000 --> 00:01:00,000
images.

16
00:01:00,000 --> 00:01:04,000
I will use Roboflow to annotate these images.

17
00:01:04,000 --> 00:01:08,000
So the currently the dataset is being downloaded, so it might take some time.

18
00:01:08,000 --> 00:01:08,000
Okay.

19
00:01:08,000 --> 00:01:16,000
So as these images gets downloaded then I will unzip this folder and then I will upload all these images

20
00:01:16,000 --> 00:01:22,000
onto the roboflow and then we will annotate all these images and then it will train our YOLO V8 segmentation

21
00:01:22,000 --> 00:01:23,000
model.

22
00:01:23,000 --> 00:01:26,000
So the dataset is about to download.

23
00:01:26,000 --> 00:01:28,000
So let me open the roboflow in the meanwhile.

24
00:01:28,000 --> 00:01:30,000
So just write roboflow over here.

25
00:01:30,000 --> 00:01:36,000
So if you haven't created a Count Rover Roboflow I recommend you to create an account on Roboflow So

26
00:01:36,000 --> 00:01:39,000
using Roboflow we will annotate these images portable images.

27
00:01:39,000 --> 00:01:43,000
So if you haven't created your account you need to sign up.

28
00:01:43,000 --> 00:01:46,000
But as I have created my account so I just need to sign in.

29
00:01:48,000 --> 00:01:51,000
Okay, so I'm just signing in, and then I will.

30
00:01:52,000 --> 00:01:53,000
Okay.

31
00:01:53,000 --> 00:01:55,000
So I will continue with Google.

32
00:01:55,000 --> 00:01:56,000
So I've already have an account.

33
00:01:56,000 --> 00:02:01,000
You can create an account as well if you haven't created this account previously.

34
00:02:03,000 --> 00:02:03,000
I'm okay.

35
00:02:03,000 --> 00:02:05,000
So it's just sign in.

36
00:02:05,000 --> 00:02:07,000
So this might take a few seconds.

37
00:02:07,000 --> 00:02:11,000
Okay, so the dataset is downloaded and if I go over here.

38
00:02:12,000 --> 00:02:13,000
Okay, let me just.

39
00:02:13,000 --> 00:02:16,000
Okay, so I have just signed into the roboflow.

40
00:02:16,000 --> 00:02:17,000
So this is my roboflow account.

41
00:02:17,000 --> 00:02:22,000
I have just sign in and this is my workplace space by the name of my workspace is mine.

42
00:02:22,000 --> 00:02:25,000
You can create any name of the workspace if you want.

43
00:02:25,000 --> 00:02:27,000
And just please create a public workspace.

44
00:02:27,000 --> 00:02:32,000
If you create a public private workspace, you will not be able to export the dataset from Roboflow

45
00:02:32,000 --> 00:02:34,000
into the Google CoLab notebook.

46
00:02:34,000 --> 00:02:38,000
So it's always better to create a public workspace, not a private workspace.

47
00:02:38,000 --> 00:02:42,000
So I've created a public workspace over here.

48
00:02:43,000 --> 00:02:47,000
If I show you how and I tell you that this is a public workspace.

49
00:02:47,000 --> 00:02:52,000
So if I go over here so you can see that the workspace is not free public plan.

50
00:02:52,000 --> 00:02:58,000
So this shows that the my workspace is on a free public plan and I can easily export this dataset from

51
00:02:58,000 --> 00:03:01,000
here to into the Google CoLab notebook.

52
00:03:03,000 --> 00:03:03,000
Next.

53
00:03:03,000 --> 00:03:05,000
Let me show you the images over here.

54
00:03:05,000 --> 00:03:06,000
So just give me a minute.

55
00:03:06,000 --> 00:03:10,000
I'm just navigating to the folder where I have the images placed.

56
00:03:10,000 --> 00:03:11,000
Okay.

57
00:03:11,000 --> 00:03:14,000
So I have this place, this image dataset.

58
00:03:18,000 --> 00:03:21,000
Well, I have placed the image zipped folder over here.

59
00:03:21,000 --> 00:03:22,000
Let me just show you.

60
00:03:22,000 --> 00:03:27,000
So now you can see this zip folder, which I have downloaded the images from Kaggle.

61
00:03:27,000 --> 00:03:29,000
So just unzip this folder over here.

62
00:03:31,000 --> 00:03:36,000
Okay, so this might take a few more seconds, so let's wait and see.

63
00:03:36,000 --> 00:03:42,000
Okay, so this is the unzipped folder and it contains all the pothos images which you can see over here.

64
00:03:42,000 --> 00:03:45,000
So these are around 616 images.

65
00:03:45,000 --> 00:03:51,000
But as we are just training and testing our models, so we'll only take 96 images and then we will annotate

66
00:03:51,000 --> 00:03:57,000
these 96 images and then we will train our YOLO segmentation model on these 98 images.

67
00:03:57,000 --> 00:04:04,000
So let me go back to my Roboflow account and let me upload these images over there and let me annotate

68
00:04:04,000 --> 00:04:05,000
these images.

69
00:04:05,000 --> 00:04:07,000
So first of all, I will click on Create New project.

70
00:04:08,000 --> 00:04:08,000
Okay.

71
00:04:08,000 --> 00:04:10,000
So basically.

72
00:04:15,000 --> 00:04:17,000
As I am doing instant segmentation.

73
00:04:17,000 --> 00:04:20,000
So I will just select instant segmentation from here.

74
00:04:20,000 --> 00:04:23,000
And what I am detecting is potholes.

75
00:04:23,000 --> 00:04:29,000
I'm just writing potholes over here and write here potholes, segmentation.

76
00:04:29,000 --> 00:04:34,000
So this is the name of my project Pothole segmentation and detection and segmentation.

77
00:04:34,000 --> 00:04:39,000
Basically, we are detecting the potholes and doing the segmentation as well.

78
00:04:39,000 --> 00:04:43,000
So this is the name of my project and I will create a public project.

79
00:04:43,000 --> 00:04:49,000
So the dataset which will be available to public so anyone can access this dataset through your Roboflow

80
00:04:49,000 --> 00:04:50,000
universe as well.

81
00:04:50,000 --> 00:04:55,000
So I'm just creating a public project, so this might take few seconds.

82
00:04:55,000 --> 00:05:02,000
So let please bear with me and let us create a public project over here.

83
00:05:02,000 --> 00:05:06,000
So project type instant segmentation, what are you detecting?

84
00:05:06,000 --> 00:05:10,000
Potholes, project name, potholes, detection and segmentation.

85
00:05:10,000 --> 00:05:15,000
And I'm just creating a public project, so this will take a few seconds.

86
00:05:15,000 --> 00:05:15,000
Okay.

87
00:05:22,000 --> 00:05:23,000
For the project.

88
00:05:23,000 --> 00:05:25,000
A public project is created over here.

89
00:05:25,000 --> 00:05:29,000
You can see that the project name, potholes, detection and segmentation.

90
00:05:29,000 --> 00:05:33,000
So now I will upload the image dataset from here.

91
00:05:33,000 --> 00:05:35,000
I will just go to YOLO V8 folder.

92
00:05:35,000 --> 00:05:38,000
We have the pothole images.

93
00:05:38,000 --> 00:05:39,000
So just.

94
00:05:40,000 --> 00:05:45,000
Okay, so here I will just upload these images around.

95
00:05:46,000 --> 00:05:52,000
Let me upload 100 images and this will be enough for training the segmentation model and testing it

96
00:05:52,000 --> 00:05:58,000
that whether our model is able to detect the potholes or not and do the segmentation of the potholes

97
00:05:58,000 --> 00:05:59,000
or not.

98
00:05:59,000 --> 00:05:59,000
Okay.

99
00:05:59,000 --> 00:06:01,000
So let me just upload.

100
00:06:01,000 --> 00:06:02,000
Okay.

101
00:06:02,000 --> 00:06:04,000
So just let me just upload the 98 images.

102
00:06:05,000 --> 00:06:05,000
Okay.

103
00:06:05,000 --> 00:06:09,000
So the first step am uploading this images into the robot.

104
00:06:09,000 --> 00:06:12,000
So then in the next step I will annotate all these images.

105
00:06:12,000 --> 00:06:13,000
Okay, so.

106
00:06:14,000 --> 00:06:17,000
Just click on Save and you can continue.

107
00:06:17,000 --> 00:06:22,000
So currently you can see that all these images are not annotated like 98 images.

108
00:06:22,000 --> 00:06:24,000
All of these images are not annotated.

109
00:06:24,000 --> 00:06:29,000
I will annotate all these images and explain you all these things.

110
00:06:29,000 --> 00:06:32,000
So I will annotate all these images one by one.

111
00:06:32,000 --> 00:06:33,000
Okay.

112
00:06:33,000 --> 00:06:39,000
So currently you can see that all these images are not annotated, but I will annotate all these images,

113
00:06:39,000 --> 00:06:40,000
so don't worry.

114
00:06:40,000 --> 00:06:43,000
So as am on the only one working on this project.

115
00:06:43,000 --> 00:06:46,000
So I will assign all these invitation to myself.

116
00:06:46,000 --> 00:06:52,000
But if you have a group member or a fellow working on this project, on any project with you, you can

117
00:06:52,000 --> 00:06:57,000
invite your teammate and assign some part of the images to him to do the annotation or remaining you

118
00:06:57,000 --> 00:06:58,000
can do yourself.

119
00:06:58,000 --> 00:07:04,000
Okay, so as I am only one working on this project or this tutorial, so I will assign this images to

120
00:07:04,000 --> 00:07:04,000
myself.

121
00:07:04,000 --> 00:07:07,000
So now I will do the annotation of all these images.

122
00:07:07,000 --> 00:07:10,000
So it's currently annotated and illustrated.

123
00:07:10,000 --> 00:07:14,000
98 images are unintegrated and zero images are annotated.

124
00:07:14,000 --> 00:07:19,000
So as we do the annotations, the number of annotated images will increase.

125
00:07:19,000 --> 00:07:23,000
So let's me click on the first images and do the annotation over here.

126
00:07:23,000 --> 00:07:28,000
So to the annotation, you will just need to click on the polygon tool over here.

127
00:07:28,000 --> 00:07:31,000
And just so here we can see a pothole.

128
00:07:31,000 --> 00:07:34,000
So just click over here, here, here, here, here.

129
00:07:34,000 --> 00:07:37,000
And then here we are just getting up.

130
00:07:38,000 --> 00:07:40,000
So in this way you will do the annotation.

131
00:07:40,000 --> 00:07:43,000
Okay, so I can see a pothole over here as well.

132
00:07:43,000 --> 00:07:47,000
So just let's do the annotation over here, okay?

133
00:07:48,000 --> 00:07:51,000
So in simple detection, we just draw a bounding box.

134
00:07:51,000 --> 00:07:53,000
Okay, Just create a rectangle bounding box.

135
00:07:53,000 --> 00:07:59,000
But in case of segmentation, we need to do this type of polygon annotation, which you can see over

136
00:07:59,000 --> 00:07:59,000
here.

137
00:07:59,000 --> 00:08:01,000
So there are two potholes in this images.

138
00:08:01,000 --> 00:08:09,000
So we have annotated both and okay, so let me add the label say okay, so you can see that this is

139
00:08:09,000 --> 00:08:12,000
the first pothole and this is the second pothole.

140
00:08:12,000 --> 00:08:15,000
So in this way I will do and create my second image over here.

141
00:08:15,000 --> 00:08:18,000
So just go over here and just click on this.

142
00:08:18,000 --> 00:08:22,000
Click on this, click on this click, click, click, click, click.

143
00:08:23,000 --> 00:08:24,000
Okay, so let me see.

144
00:08:24,000 --> 00:08:26,000
Okay, Just click on Save and Enter.

145
00:08:26,000 --> 00:08:29,000
So now you can see that we have a pothole over here.

146
00:08:29,000 --> 00:08:33,000
I cannot see any other pothole in this image, so let's go further.

147
00:08:33,000 --> 00:08:34,000
Okay.

148
00:08:34,000 --> 00:08:35,000
This one is a big pothole.

149
00:08:35,000 --> 00:08:37,000
Okay, So just do it.

150
00:08:37,000 --> 00:08:39,000
Do it, do it, do it.

151
00:08:39,000 --> 00:08:40,000
Now that's good.

152
00:08:40,000 --> 00:08:46,000
So in this way, I am just annotating all these images and the label which I am assigning is potholes.

153
00:08:46,000 --> 00:08:50,000
Okay, so next I will annotate this image.

154
00:08:52,000 --> 00:08:57,000
Okay, so in this way I will annotate all the 100 images one by one.

155
00:08:57,000 --> 00:08:58,000
Okay.

156
00:08:58,000 --> 00:09:00,000
So you can see that I've entered this image as well.

157
00:09:00,000 --> 00:09:03,000
So now let's annotate this image.

158
00:09:03,000 --> 00:09:04,000
Okay?

159
00:09:04,000 --> 00:09:06,000
This image contain many potholes.

160
00:09:06,000 --> 00:09:09,000
Okay, so let me annotate these images as well.

161
00:09:10,000 --> 00:09:10,000
Okay.

162
00:09:11,000 --> 00:09:12,000
Okay.

163
00:09:12,000 --> 00:09:14,000
So let's annotate this image as well.

164
00:09:18,000 --> 00:09:20,000
So let me create this image as well.

165
00:09:22,000 --> 00:09:23,000
Okay.

166
00:09:24,000 --> 00:09:26,000
This part of the image is also annotated.

167
00:09:26,000 --> 00:09:28,000
Okay, let me annotate this as well.

168
00:09:28,000 --> 00:09:29,000
Okay.

169
00:09:29,000 --> 00:09:31,000
And the label which we are assigning is pothole over here.

170
00:09:31,000 --> 00:09:32,000
Okay.

171
00:09:32,000 --> 00:09:37,000
So in this way I will estimate all the 98 images one by one.

172
00:09:37,000 --> 00:09:39,000
So this is a quite time consuming process.

173
00:09:39,000 --> 00:09:45,000
So I'm just pausing the video and let me annotate all these 98 images like I did for the first five

174
00:09:45,000 --> 00:09:52,000
and then I will be back and then we will generate, uh, generate the dataset and then export this dataset

175
00:09:52,000 --> 00:09:58,000
into our Google CoLab notebook and train our YOLO segmentation model on the potholes dataset.

176
00:10:03,000 --> 00:10:06,000
Well, now you can see that all the images are annotated.

177
00:10:06,000 --> 00:10:12,000
So if I click on here, like you can see that I have annotated all these images over here.

178
00:10:12,000 --> 00:10:18,000
And if I click over here, you can see that the images are annotated like where we have the potholes.

179
00:10:18,000 --> 00:10:20,000
We have drawn the mask over here.

180
00:10:20,000 --> 00:10:25,000
So in this way we have annotated all the 96 images which you can see over here.

181
00:10:25,000 --> 00:10:28,000
So all the 96 images are now annotated.

182
00:10:28,000 --> 00:10:32,000
So let me just go to generate and generate this dataset.

183
00:10:32,000 --> 00:10:36,000
So now you can see that we have only one class, which is part one.

184
00:10:36,000 --> 00:10:37,000
We have 96 images.

185
00:10:37,000 --> 00:10:40,000
All the images are annotated and uneducated images.

186
00:10:40,000 --> 00:10:40,000
Zero.

187
00:10:41,000 --> 00:10:46,000
The 84th 84 images are for training, while images are for the validation.

188
00:10:46,000 --> 00:10:48,000
And we are not taking any images for the testing.

189
00:10:48,000 --> 00:10:51,000
But if you want, you can just set it.

190
00:10:52,000 --> 00:10:53,000
Let me just do a rebalance.

191
00:10:53,000 --> 00:11:03,000
You can just click on rebalance and let me just set it as okay, so 76 images are used for training,

192
00:11:03,000 --> 00:11:08,000
15 images are used for the validation and five images are used for the testing purpose.

193
00:11:08,000 --> 00:11:08,000
Okay.

194
00:11:08,000 --> 00:11:15,000
So in this way I have set the class balance as training images contain the 79% images, 16% images are

195
00:11:15,000 --> 00:11:18,000
in the validation portal and 5% images are in the testing folder.

196
00:11:18,000 --> 00:11:21,000
So you can rebalance it as per your requirements.

197
00:11:22,000 --> 00:11:23,000
Okay, now.

198
00:11:24,000 --> 00:11:32,000
In the pre-processing we can always pass as a pre-trained modular V8 segmentation model.

199
00:11:32,000 --> 00:11:38,000
Segmentation Pre-trained model is being trained on coco dataset and the image size which is default

200
00:11:38,000 --> 00:11:45,000
is 640 cross 640 So it's always better to set the same image size or because we are just fine tuning

201
00:11:45,000 --> 00:11:49,000
the YOLO segmentation model on the potholes, the images.

202
00:11:49,000 --> 00:11:55,000
So it's always better to set the image size as 640 cross 640 because if we increase the image size or

203
00:11:55,000 --> 00:11:59,000
less the image size, then we are basic, then we may compromise on the accuracy.

204
00:11:59,000 --> 00:12:00,000
Okay.

205
00:12:00,000 --> 00:12:07,000
So just so if your data set is not very much large, so it's always better to do the data augmentation.

206
00:12:07,000 --> 00:12:13,000
So data augmentation not only increase the size of the data set, but make the model resilient.

207
00:12:13,000 --> 00:12:14,000
Okay as well.

208
00:12:14,000 --> 00:12:16,000
So I will do two annotations.

209
00:12:16,000 --> 00:12:22,000
I will just add one is the this, I will add two annotations.

210
00:12:22,000 --> 00:12:25,000
So let me just add this data annotation.

211
00:12:25,000 --> 00:12:29,000
So okay, no, I don't think this will work very well.

212
00:12:29,000 --> 00:12:32,000
So let's see other annotations as well over here.

213
00:12:35,000 --> 00:12:40,000
So let's just add this rotation and rotation like my single images will be.

214
00:12:41,000 --> 00:12:45,000
So from a single images, two images will be generated using this rotation augmentation.

215
00:12:45,000 --> 00:12:51,000
One will be one will be with -15 degree shift and other will have a plus 15 degree shift.

216
00:12:51,000 --> 00:12:57,000
So from a single image, two images will be generated, one with a -15 degree shift and other with the

217
00:12:57,000 --> 00:12:58,000
plus 15 degree shift.

218
00:12:58,000 --> 00:13:04,000
So let me apply this and let me only consider this on this augmentation.

219
00:13:04,000 --> 00:13:06,000
So now I will generate this images.

220
00:13:06,000 --> 00:13:12,000
So now you can see that as I am generating these two two images from a single image using rotation with

221
00:13:12,000 --> 00:13:15,000
-15 degree and plus 15 degree.

222
00:13:15,000 --> 00:13:17,000
So now the dataset size has increased now.

223
00:13:17,000 --> 00:13:22,000
So if I click on Generate, it will generate my dataset.

224
00:13:22,000 --> 00:13:27,000
So then I will be able to export this dataset from Roboflow into the Google CoLab notebook.

225
00:13:30,000 --> 00:13:37,000
Now clicking on generate and creating my dataset, finalizing my dataset so it will create the first

226
00:13:37,000 --> 00:13:39,000
version of the dataset.

227
00:13:39,000 --> 00:13:44,000
You can add more images into the dataset as well and generate a new version with it.

228
00:13:44,000 --> 00:13:51,000
So now you can see that this is our version is generated, so the data augmentation is only applied

229
00:13:51,000 --> 00:13:56,000
to the training set and the data augmentation is not applied on the validation set and the testing set.

230
00:13:56,000 --> 00:14:02,000
So now you can see that like this image, we have a -15 degree shift like we did in the using a data

231
00:14:02,000 --> 00:14:04,000
augmentation rotation technique.

232
00:14:04,000 --> 00:14:11,000
And here we can see the plus 15 degree shift, which we did using the data augmentation rotation approach.

233
00:14:11,000 --> 00:14:12,000
Okay.

234
00:14:12,000 --> 00:14:18,000
So now we will just export this dataset from Roboflow into our Google CoLab notebook.

235
00:14:18,000 --> 00:14:19,000
So just select a format.

236
00:14:19,000 --> 00:14:24,000
You can select either select the YOLO V8 or YOLO V5 PyTorch format because both these versions were

237
00:14:24,000 --> 00:14:25,000
released by Ultralytics.

238
00:14:25,000 --> 00:14:32,000
So using Yolov5 PyTorch format, you can also export this dataset from Roboflow into the YOLO Google

239
00:14:32,000 --> 00:14:35,000
CoLab notebook and train the YOLO V8 segmentation model.

240
00:14:35,000 --> 00:14:42,000
So also train a model from label with don't want to train the YOLO segmentation model using Roboflow

241
00:14:43,000 --> 00:14:47,000
will train the YOLO segmentation model with one my Google CoLab notebook.

242
00:14:47,000 --> 00:14:52,000
So just unselect it and click on continue so it will generate some python code.

243
00:14:52,000 --> 00:14:58,000
So using this python code, I will export this dataset from roboflow into my Google CoLab notebook.

244
00:14:59,000 --> 00:15:02,000
So it's zipping the files of that dataset image.

245
00:15:02,000 --> 00:15:04,000
So this might take few seconds.

246
00:15:04,000 --> 00:15:11,000
So as the dataset is prepared, then we will export this dataset from Roboflow into our Google CoLab

247
00:15:11,000 --> 00:15:16,000
notebook, and then we will train our YOLO segmentation model on this.

248
00:15:16,000 --> 00:15:18,000
Potholes Images dataset.

249
00:15:19,000 --> 00:15:19,000
Okay.

250
00:15:22,000 --> 00:15:24,000
So this might take some time over here.

251
00:15:24,000 --> 00:15:27,000
So I'm just waiting for it to get repaired.

252
00:15:27,000 --> 00:15:32,000
And then I will export this dataset from Roboflow into the Google CoLab notebook.

253
00:15:35,000 --> 00:15:36,000
So here I have the download code.

254
00:15:36,000 --> 00:15:42,000
So using this download code I will export this dataset from roboflow into my Google CoLab notebook.

255
00:15:42,000 --> 00:15:51,000
If you are trying to implement this project on any other like PyCharm Anaconda Navigator or Visual Studio

256
00:15:51,000 --> 00:15:54,000
or Spyder, you can use this terminal command over here.

257
00:15:54,000 --> 00:16:00,000
But if you are doing on the Notebook like CoLab Notebook or Jupyter Notebook, then you can use this

258
00:16:00,000 --> 00:16:01,000
download code over here.

259
00:16:01,000 --> 00:16:08,000
But if you are doing in PyCharm or Visual Studio or you are doing in Spyder, then you can use this

260
00:16:08,000 --> 00:16:09,000
terminal command from here.

261
00:16:09,000 --> 00:16:17,000
Okay, so in using this code, I will export this dataset from Roboflow into my Google CoLab notebook.

262
00:16:17,000 --> 00:16:25,000
So in the next part we will see how we can train YOLO segmentation model on this Potholes images dataset.

263
00:16:25,000 --> 00:16:31,000
And let's go towards the next part and let's train our YOLO weird segmentation model on the Potholes

264
00:16:31,000 --> 00:16:35,000
images dataset which we have prepared in this video tutorial.

