1
00:00:02,000 --> 00:00:03,000
Hi guys.

2
00:00:03,000 --> 00:00:08,000
In this video tutorial we will see how we can implement pen and book detection with YOLO V8.

3
00:00:09,000 --> 00:00:15,000
This is a complete end to end video tutorial, so I will start with gathering or collecting the dataset

4
00:00:15,000 --> 00:00:20,000
to collect or gather the dataset for this project I will go to open image dataset.

5
00:00:22,000 --> 00:00:26,000
Just type open the dataset over here and click on the first link over here.

6
00:00:27,000 --> 00:00:29,000
Okay, so we will click on Explore.

7
00:00:32,000 --> 00:00:38,000
And over here you will find type as you want to detect not segmentation.

8
00:00:38,000 --> 00:00:41,000
We are not currently performing segmentation.

9
00:00:41,000 --> 00:00:43,000
We are only focusing on detection.

10
00:00:43,000 --> 00:00:45,000
So I will click on detection.

11
00:00:46,000 --> 00:00:46,000
Okay.

12
00:00:47,000 --> 00:00:50,000
So here will take on, first of all, Ben.

13
00:00:51,000 --> 00:00:53,000
And this over here.

14
00:00:54,000 --> 00:00:58,000
So you can see that I have a many number of images for with pen.

15
00:00:58,000 --> 00:00:59,000
You can see there.

16
00:00:59,000 --> 00:01:02,000
So there is a data set for the pen over here.

17
00:01:02,000 --> 00:01:09,000
But you can see that like tablet is also shown in the image plus person is also shown in the image.

18
00:01:09,000 --> 00:01:18,000
So I only want pen to be detected, not other things like chocolates over here, ink over here.

19
00:01:18,000 --> 00:01:19,000
So I will just go to random.

20
00:01:20,000 --> 00:01:24,000
I will just go to sorry, just click on pen over here.

21
00:01:25,000 --> 00:01:31,000
And go to option and just uncheck this box like display box for all categories from all categories.

22
00:01:31,000 --> 00:01:34,000
Only need that bounding boxes one pen.

23
00:01:34,000 --> 00:01:37,000
So just unchecking it and let's see.

24
00:01:37,000 --> 00:01:39,000
So here I have the bounding box with the pen.

25
00:01:40,000 --> 00:01:42,000
Here I have the bounding box with the pen.

26
00:01:42,000 --> 00:01:47,000
So you can see that all the other bounding boxes which are previously with cups or other objects are

27
00:01:47,000 --> 00:01:48,000
not there.

28
00:01:48,000 --> 00:01:52,000
So they are only, only the various pen there.

29
00:01:52,000 --> 00:01:56,000
We have a bounding box so we have only bounding boxes with the pen.

30
00:01:56,000 --> 00:01:58,000
You can see over here as well.

31
00:01:58,000 --> 00:01:59,000
Okay.

32
00:01:59,000 --> 00:02:00,000
The other thing we need is book.

33
00:02:00,000 --> 00:02:04,000
So I will type book over here and just click on Enter over here.

34
00:02:07,000 --> 00:02:11,000
So you can see that we have book over here.

35
00:02:11,000 --> 00:02:12,000
Okay, that's fine.

36
00:02:12,000 --> 00:02:13,000
We have currently a book.

37
00:02:13,000 --> 00:02:15,000
This book images as well.

38
00:02:15,000 --> 00:02:18,000
And we have also book images as well.

39
00:02:19,000 --> 00:02:20,000
Okay, that's cool.

40
00:02:20,000 --> 00:02:26,000
So we have the data set available for Penn and book on image data set or images data set.

41
00:02:26,000 --> 00:02:33,000
V7 So if we want to get this data set or download this data set into our CoLab notebook, what we will

42
00:02:33,000 --> 00:02:38,000
do is we will go to just open a new tab over here.

43
00:02:42,000 --> 00:02:43,000
That's right.

44
00:02:43,000 --> 00:02:44,000
Open image dataset.

45
00:02:47,000 --> 00:02:47,000
Before.

46
00:02:49,000 --> 00:02:50,000
Will get.

47
00:02:52,000 --> 00:02:52,000
GitHub.

48
00:02:53,000 --> 00:02:53,000
Okay.

49
00:02:56,000 --> 00:02:59,000
So just open this first link over here.

50
00:03:00,000 --> 00:03:07,000
So using this toolkit available in this GitHub repo, I will download the dataset from open images dataset

51
00:03:07,000 --> 00:03:10,000
into my Google CoLab notebook.

52
00:03:10,000 --> 00:03:10,000
Okay.

53
00:03:10,000 --> 00:03:15,000
So first we need to just clone this GitHub repo into my Google CoLab notebook.

54
00:03:15,000 --> 00:03:20,000
So here I have already created a Google CoLab notebook with the required script, sir.

55
00:03:20,000 --> 00:03:22,000
So just run this cell.

56
00:03:23,000 --> 00:03:29,000
First we are importing the library library helpers to navigate between different folders or.

57
00:03:30,000 --> 00:03:34,000
Basically, we can also navigate gate between different folders files as well.

58
00:03:34,000 --> 00:03:37,000
Thus we are importing glob ipython dot display.

59
00:03:37,000 --> 00:03:44,000
Basically we need ipython library if you want to display or any input or output image into our google

60
00:03:44,000 --> 00:03:48,000
CoLab notebook and using display dot clear dash output.

61
00:03:48,000 --> 00:03:51,000
I am placing all my previous outputs.

62
00:03:51,000 --> 00:03:55,000
So first of all, we need to make sure that we have selected the runtime as GPU.

63
00:03:55,000 --> 00:04:02,000
So just go over here, click on runtime and select Change runtime and Select Hardware accelerator as

64
00:04:02,000 --> 00:04:03,000
GPU and click on Save.

65
00:04:05,000 --> 00:04:09,000
So just checking if we are using GPU memory.

66
00:04:09,000 --> 00:04:11,000
So it will take a few seconds.

67
00:04:11,000 --> 00:04:12,000
Okay.

68
00:04:12,000 --> 00:04:14,000
So currently we have GPU memory usage.

69
00:04:14,000 --> 00:04:14,000
Okay.

70
00:04:14,000 --> 00:04:15,000
That's fine.

71
00:04:15,000 --> 00:04:16,000
So.

72
00:04:17,000 --> 00:04:19,000
First of all, I will just.

73
00:04:20,000 --> 00:04:22,000
Clone this github repo over here.

74
00:04:22,000 --> 00:04:23,000
Just right.

75
00:04:23,000 --> 00:04:24,000
Just ctrl V over here.

76
00:04:25,000 --> 00:04:31,000
We so we will clone the id v4 duplicate to download the images from the open image dataset.

77
00:04:31,000 --> 00:04:33,000
Okay, now just run this cell.

78
00:04:37,000 --> 00:04:39,000
So it might take a few more seconds.

79
00:04:40,000 --> 00:04:43,000
So it has run now.

80
00:04:43,000 --> 00:04:43,000
Let's see.

81
00:04:43,000 --> 00:04:45,000
What is our present working directory is.

82
00:04:47,000 --> 00:04:51,000
All we need to set the current directory as V4 toolkit so we can run this script.

83
00:04:52,000 --> 00:04:57,000
Okay, so just setting the current directory as V4 toolkit.

84
00:04:57,000 --> 00:04:59,000
Now we need to install all the requirements.

85
00:04:59,000 --> 00:05:01,000
So here we have the requirements file.

86
00:05:02,000 --> 00:05:09,000
So just click PIP, install minus requirements, minus s minus R means we are reading all the requirements.

87
00:05:10,000 --> 00:05:16,000
So it might take a few seconds to install all the required libraries to required to run this script.

88
00:05:17,000 --> 00:05:17,000
Okay.

89
00:05:18,000 --> 00:05:23,000
So by RSA URL, IB, all these libraries are now installed.

90
00:05:24,000 --> 00:05:28,000
So here I will be downloading the pen and book images dataset.

91
00:05:28,000 --> 00:05:34,000
So first of all, we will run the Help command to see what different functionalities are available over

92
00:05:34,000 --> 00:05:34,000
here.

93
00:05:38,000 --> 00:05:38,000
Okay.

94
00:05:41,000 --> 00:05:48,000
Well, you can see here we have the option of a cash limit defines how many image we want to download

95
00:05:48,000 --> 00:05:49,000
for each of the class.

96
00:05:50,000 --> 00:05:50,000
Okay.

97
00:05:50,000 --> 00:05:53,000
And we have multi classes, 0 or 1.

98
00:05:53,000 --> 00:05:56,000
So by default, it is set to zero.

99
00:05:56,000 --> 00:05:57,000
Okay.

100
00:05:57,000 --> 00:06:02,000
So if it is set to zero, it will download all the images into different classes.

101
00:06:02,000 --> 00:06:06,000
But we basically want to have all the images in the training.

102
00:06:06,000 --> 00:06:10,000
First of all, we need all the pen and book images in the training set.

103
00:06:10,000 --> 00:06:13,000
Then we need all the pen and book images in the validation set.

104
00:06:13,000 --> 00:06:16,000
Then we need all the pen and book images in the test set.

105
00:06:16,000 --> 00:06:19,000
So we will set like multi classes as one.

106
00:06:19,000 --> 00:06:25,000
We don't need images in different directories like pen images in the different directory book images

107
00:06:25,000 --> 00:06:26,000
in the different directory.

108
00:06:26,000 --> 00:06:30,000
We need all the pen and book images in a single directory, so we'll stick one.

109
00:06:31,000 --> 00:06:37,000
Thus for that, if we see the thing which can be important for us is tied to CSP.

110
00:06:37,000 --> 00:06:43,000
So if stack type as train, so it will only download the training images.

111
00:06:43,000 --> 00:06:48,000
If I select it as validation, it will stack only download the validation images.

112
00:06:48,000 --> 00:06:51,000
If I select it as test, it will only download the test images.

113
00:06:51,000 --> 00:06:57,000
But if I stack type as csvs all it will download training, validation and test images.

114
00:06:57,000 --> 00:07:03,000
So I will select Typekit csv all to download the training, validation and test images.

115
00:07:03,000 --> 00:07:08,000
Okay, so here I am just running this python main.py downloader.

116
00:07:08,000 --> 00:07:14,000
So I'm basically downloading the images classes for which class I am downloading the images I want to

117
00:07:14,000 --> 00:07:19,000
download for the pen class and for the book class and type CSV.

118
00:07:19,000 --> 00:07:23,000
We have selected all to download the train validation and test classes.

119
00:07:23,000 --> 00:07:26,000
Plus we have selected multi classes as one.

120
00:07:26,000 --> 00:07:32,000
So in the training directory we will have the images for the pen and books.

121
00:07:32,000 --> 00:07:32,000
Okay.

122
00:07:32,000 --> 00:07:36,000
If I select multi classes as zero, then we will have different folders.

123
00:07:36,000 --> 00:07:42,000
Like we will have a separate folder for the pen pen class and we will have a separate folder for the

124
00:07:42,000 --> 00:07:48,000
book class while selecting multi classes as one makes a.

125
00:07:48,000 --> 00:07:54,000
Downloads pen and book images into a single directory while selecting multi classes as zero.

126
00:07:54,000 --> 00:07:58,000
Downloads the book and pen and book images into different directories.

127
00:07:58,000 --> 00:08:01,000
Okay, so here I'm setting the limit as 120.

128
00:08:01,000 --> 00:08:06,000
So 120 images for the pen class will be downloaded in the training set.

129
00:08:06,000 --> 00:08:11,000
120 images for the book class will be downloaded in that training set.

130
00:08:11,000 --> 00:08:18,000
Similarly, 120 images for the test class will put 120 images for the pen class will be there in the

131
00:08:18,000 --> 00:08:26,000
test set and 120 images for the book class will be there in the test set and 120 images for the PEN

132
00:08:26,000 --> 00:08:31,000
class will be there in the validation and 120 images for the book class will be there in the validation.

133
00:08:32,000 --> 00:08:34,000
So here we have to find the limit.

134
00:08:34,000 --> 00:08:36,000
Now just run this cell as well.

135
00:08:37,000 --> 00:08:39,000
It will download all the images.

136
00:08:41,000 --> 00:08:45,000
Yeah, just right over here and click on Enter.

137
00:08:46,000 --> 00:08:49,000
So it might take two seconds for the exhibition.

138
00:08:49,000 --> 00:08:50,000
And just right over here again.

139
00:08:53,000 --> 00:08:56,000
So this process might take some time.

140
00:08:58,000 --> 00:08:58,000
7%.

141
00:08:58,000 --> 00:08:59,000
10%.

142
00:09:00,000 --> 00:09:01,000
13%.

143
00:09:01,000 --> 00:09:02,000
15%.

144
00:09:06,000 --> 00:09:09,000
So it is a bit slow process and it will take some time.

145
00:09:14,000 --> 00:09:19,000
So now you can see that the data set for both the classes, pen and book has been downloaded.

146
00:09:19,000 --> 00:09:21,000
You can see here it's done.

147
00:09:21,000 --> 00:09:27,000
So where we can see the images, you just need to click over here and just move to dataset.

148
00:09:27,000 --> 00:09:29,000
And here you can see that train.

149
00:09:30,000 --> 00:09:33,000
And here you have all the images.

150
00:09:33,000 --> 00:09:34,000
Okay, just give me.

151
00:09:34,000 --> 00:09:41,000
So here you have all the images over here and in the label section, we have the label for each of the.

152
00:09:42,000 --> 00:09:43,000
Image.

153
00:09:43,000 --> 00:09:48,000
Okay, so here we have the test for the test plus images and labels as well.

154
00:09:48,000 --> 00:09:53,000
Plus, here we have for the validation class images and labels as well.

155
00:09:53,000 --> 00:09:59,000
You can see over here, here are the labels and here are all the images for the validation class as

156
00:09:59,000 --> 00:09:59,000
well.

157
00:09:59,000 --> 00:10:06,000
So now basically we need to convert this data into a zip format and download into our local computer

158
00:10:06,000 --> 00:10:12,000
so that we can upload it on roboflow and convert it into the YOLO V8 PyTorch format.

159
00:10:12,000 --> 00:10:17,000
So just copy this from here and just paste this.

160
00:10:17,000 --> 00:10:20,000
Just remove this and just paste this over here and here.

161
00:10:20,000 --> 00:10:28,000
I have written the name of my zip file and the zip file will be placed over here and you can add any

162
00:10:28,000 --> 00:10:30,000
name over here as per your choice.

163
00:10:30,000 --> 00:10:36,000
Okay, so this dataset will be converted into a file zip file, which name is dataset.zip.

164
00:10:36,000 --> 00:10:38,000
So just run this cell.

165
00:10:39,000 --> 00:10:45,000
So now we are just converting our dataset in train test and validation dataset into a zip format.

166
00:10:45,000 --> 00:10:49,000
So now you can see the zip file over here, dataset.zip.

167
00:10:49,000 --> 00:10:54,000
So just click on, download and download this file into your local computer.

168
00:10:55,000 --> 00:10:56,000
So.

169
00:10:57,000 --> 00:11:04,000
It might take a few minutes or some time to download, but I have already downloaded this dataset into

170
00:11:04,000 --> 00:11:07,000
my local computer before making this tutorial.

171
00:11:07,000 --> 00:11:12,000
So here you can see the dataset file and I have unzipped it and here we have the dataset.

172
00:11:13,000 --> 00:11:14,000
Golden after unzipping it.

173
00:11:14,000 --> 00:11:19,000
And here we have the train test and validation folders.

174
00:11:19,000 --> 00:11:20,000
Okay.

175
00:11:20,000 --> 00:11:26,000
So you can see over here and here is the training folder and here are the images and labels and here

176
00:11:26,000 --> 00:11:30,000
is the validation folder and here are the images and labels.

177
00:11:30,000 --> 00:11:37,000
So let me go to the roboflow and create an account over there and load all this dataset over there.

178
00:11:37,000 --> 00:11:39,000
Okay, so just click on new tab.

179
00:11:40,000 --> 00:11:43,000
Let's right here Roboflow and click Enter.

180
00:11:43,000 --> 00:11:45,000
So I will go on this first link.

181
00:11:46,000 --> 00:11:51,000
Okay, so if you haven't created your account, you just need you need to sign up.

182
00:11:51,000 --> 00:11:54,000
Or if you have an account you just click on, need to click on sign in.

183
00:11:54,000 --> 00:12:00,000
So I have, uh, so let me I have already have an account, but let me show you how you can create an

184
00:12:00,000 --> 00:12:05,000
account and select the plan as public so you can export the data set from Roboflow.

185
00:12:05,000 --> 00:12:07,000
So you just need to click on sign up.

186
00:12:10,000 --> 00:12:10,000
Okay.

187
00:12:10,000 --> 00:12:13,000
And log in or create an account.

188
00:12:13,000 --> 00:12:15,000
I will create an account through my email.

189
00:12:16,000 --> 00:12:16,000
Okay.

190
00:12:16,000 --> 00:12:18,000
And just wait for a few minutes.

191
00:12:18,000 --> 00:12:20,000
I will just click over here.

192
00:12:21,000 --> 00:12:22,000
Okay.

193
00:12:22,000 --> 00:12:24,000
So it's going to log in.

194
00:12:24,000 --> 00:12:25,000
Okay.

195
00:12:25,000 --> 00:12:29,000
So it might take a few minutes to create the account, so please bear with me.

196
00:12:30,000 --> 00:12:32,000
To set up the settings and other things.

197
00:12:32,000 --> 00:12:35,000
So it might take a few minutes.

198
00:12:35,000 --> 00:12:35,000
Okay.

199
00:12:35,000 --> 00:12:40,000
So I accept that terms and service and privacy policy continue.

200
00:12:44,000 --> 00:12:45,000
Okay, then.

201
00:12:46,000 --> 00:12:51,000
I just need it for academia, purpose and workspace name as.

202
00:12:52,000 --> 00:12:53,000
Moin.

203
00:12:53,000 --> 00:12:55,000
Okay, so this is my workspace name.

204
00:12:55,000 --> 00:13:00,000
You can write any name, but just am writing my name over here.

205
00:13:00,000 --> 00:13:05,000
So currently I don't want to invite other other collaborators for this project because I'm working alone

206
00:13:05,000 --> 00:13:06,000
on this project.

207
00:13:06,000 --> 00:13:07,000
Okay, so.

208
00:13:08,000 --> 00:13:10,000
I'm using for the community purpose.

209
00:13:11,000 --> 00:13:17,000
On my dataset will be available publicly, so no need a guided tour.

210
00:13:17,000 --> 00:13:21,000
So just click one close and just click on create new project over here.

211
00:13:26,000 --> 00:13:26,000
Okay.

212
00:13:26,000 --> 00:13:29,000
So I don't need any hints.

213
00:13:29,000 --> 00:13:29,000
Okay.

214
00:13:29,000 --> 00:13:31,000
So what are you detecting?

215
00:13:31,000 --> 00:13:34,000
Basically, you are taking pen and book.

216
00:13:35,000 --> 00:13:38,000
And look just right over here.

217
00:13:38,000 --> 00:13:39,000
Project name.

218
00:13:39,000 --> 00:13:42,000
Pen, book detection.

219
00:13:42,000 --> 00:13:45,000
This is our project name and create public project.

220
00:13:45,000 --> 00:13:47,000
Click on Create Public Project.

221
00:13:49,000 --> 00:13:52,000
So now a project will be created over here.

222
00:13:52,000 --> 00:13:59,000
So just wait for a few seconds more until we are able to create a new project over here.

223
00:14:04,000 --> 00:14:10,000
And so after creating the project, I will upload all the images which are in the training validation

224
00:14:10,000 --> 00:14:17,000
and test folder into the roboflow and just we see if we need to do augmentation or not.

225
00:14:17,000 --> 00:14:24,000
And I will also verify my dataset, health and other parameters to see my dataset is balanced or unbalanced.

226
00:14:24,000 --> 00:14:28,000
So just creating the new creating a public project.

227
00:14:28,000 --> 00:14:32,000
Please note that this dataset will be available publicly as well.

228
00:14:33,000 --> 00:14:36,000
So I don't know why it's taking so much time.

229
00:14:36,000 --> 00:14:39,000
So just click on Cancel and try to create a new project.

230
00:14:40,000 --> 00:14:40,000
Okay.

231
00:14:42,000 --> 00:14:48,000
Uh, I just writing that again cause the previous was taking so much time.

232
00:14:48,000 --> 00:14:51,000
Okay, so the project is being created.

233
00:14:51,000 --> 00:14:53,000
Uh, we already did that previously.

234
00:14:54,000 --> 00:14:55,000
Just try to create a project.

235
00:14:55,000 --> 00:14:58,000
But it was taking so much time, so just close it.

236
00:14:58,000 --> 00:15:02,000
But the project has been created, which you can see here, pen book detection.

237
00:15:02,000 --> 00:15:06,000
Plus one thing I want to tell you, if you go to settings and Workspaces, Muhammad.

238
00:15:07,000 --> 00:15:08,000
This is my workspace name.

239
00:15:08,000 --> 00:15:12,000
So please show make sure that this this workspace is on the public plan.

240
00:15:12,000 --> 00:15:13,000
Okay.

241
00:15:13,000 --> 00:15:18,000
So if it is on some other plan, then you will not be able to export the data set from Roboflow into

242
00:15:18,000 --> 00:15:22,000
your CoLab notebook or into your terminal on a terminal.

243
00:15:22,000 --> 00:15:22,000
Okay.

244
00:15:23,000 --> 00:15:24,000
So just click over here.

245
00:15:26,000 --> 00:15:30,000
And click on select Select Files and just go to the dataset content.

246
00:15:32,000 --> 00:15:34,000
Why Db4 toolkit.

247
00:15:34,000 --> 00:15:35,000
4D dataset.

248
00:15:35,000 --> 00:15:43,000
First, we'll go to training, pan and book and control a upload all these files over here so it might

249
00:15:43,000 --> 00:15:48,000
take few minutes or few seconds, so please bear with me.

250
00:15:48,000 --> 00:15:48,000
So.

251
00:15:50,000 --> 00:15:50,000
In this way.

252
00:15:51,000 --> 00:15:56,000
In the similar way, you can also implement this project or any kind of object on your side as well.

253
00:16:01,000 --> 00:16:06,000
Now you can see that they are not annotated because we have not uploaded the labels file yet.

254
00:16:06,000 --> 00:16:10,000
So just uploading all the labels file here as well.

255
00:16:13,000 --> 00:16:13,000
Okay.

256
00:16:13,000 --> 00:16:18,000
So you can see that now the annotations are being done at 33, images are interpreted.

257
00:16:18,000 --> 00:16:22,000
So as this process completes, all the images will be annotated.

258
00:16:23,000 --> 00:16:25,000
So it might take a few seconds more.

259
00:16:25,000 --> 00:16:31,000
So after this I will upload the test image test dataset images and after test dataset I will upload

260
00:16:31,000 --> 00:16:33,000
the validation dataset images.

261
00:16:40,000 --> 00:16:43,000
It might take some minutes or a few seconds.

262
00:16:43,000 --> 00:16:50,000
Now I will go to select files and I will go to that dataset and upload the test dataset images over

263
00:16:50,000 --> 00:16:50,000
here.

264
00:16:51,000 --> 00:16:53,000
Control a upload.

265
00:16:53,000 --> 00:16:55,000
So now all the files are being uploaded.

266
00:16:55,000 --> 00:16:56,000
You can see that.

267
00:16:57,000 --> 00:17:06,000
It might take some time to 1730 not integrated, so it will upload slowly, gradually, so it is a bit

268
00:17:06,000 --> 00:17:07,000
time taking process.

269
00:17:07,000 --> 00:17:14,000
So it's not that you just click on and it's uploaded, but it takes some time to upload over here.

270
00:17:14,000 --> 00:17:16,000
So.

271
00:17:17,000 --> 00:17:22,000
Please be assured that me do that, upload it now will upload the labels because you can see that they

272
00:17:22,000 --> 00:17:23,000
are not annotated.

273
00:17:25,000 --> 00:17:29,000
So now I'm going to see that all the images will be annotated like You can see that.

274
00:17:31,000 --> 00:17:34,000
This will be getting less as the files of labels upload.

275
00:17:35,000 --> 00:17:39,000
Okay, so you can see that in the first step we download the 240 images.

276
00:17:39,000 --> 00:17:44,000
While in the second time we have only have 213 images because there might be some missing labels or

277
00:17:44,000 --> 00:17:45,000
classes.

278
00:17:45,000 --> 00:17:46,000
So there is some.

279
00:17:46,000 --> 00:17:50,000
We get some less images than our target, which we have written over there.

280
00:17:51,000 --> 00:17:53,000
Okay, so all the images are being uploaded.

281
00:17:53,000 --> 00:17:57,000
So you can see that we have 453 images till now.

282
00:17:57,000 --> 00:18:00,000
The either images are also being uploaded over here.

283
00:18:00,000 --> 00:18:01,000
So.

284
00:18:02,000 --> 00:18:04,000
You can see that here.

285
00:18:04,000 --> 00:18:09,000
Currently we have zero images because after I upload all the images over here and then I will click

286
00:18:09,000 --> 00:18:11,000
on Save and Continue.

287
00:18:11,000 --> 00:18:18,000
Then these images will appear in the dataset over here and then I will check the model health and other

288
00:18:18,000 --> 00:18:24,000
versions, and then I will generate the dataset after seeing that if there is any need for the pre-processing

289
00:18:24,000 --> 00:18:27,000
or not, or that is there is a need for data augmentation or not.

290
00:18:28,000 --> 00:18:37,000
So around 107 images are left which are not annotated correctly, but they will be annotated as we move

291
00:18:37,000 --> 00:18:40,000
towards the completion of this process.

292
00:18:40,000 --> 00:18:43,000
It might take some few seconds more.

293
00:18:43,000 --> 00:18:44,000
So please bear with me.

294
00:18:44,000 --> 00:18:50,000
Like the 378 images are integrated and 75 images are not integrated.

295
00:18:50,000 --> 00:18:51,000
While.

296
00:18:52,000 --> 00:18:56,000
39 images are now encrypted and 64 images are not encrypted.

297
00:18:57,000 --> 00:18:57,000
Okay.

298
00:18:57,000 --> 00:19:00,000
So these numbers are increasing.

299
00:19:00,000 --> 00:19:01,000
You can see that.

300
00:19:03,000 --> 00:19:05,000
The aim of explaining this whole process to you.

301
00:19:05,000 --> 00:19:10,000
That is that so that you can implement this same project on your side as well.

302
00:19:10,000 --> 00:19:12,000
So this is the main aim.

303
00:19:12,000 --> 00:19:16,000
Why I'm trying to implement this project from very start.

304
00:19:16,000 --> 00:19:22,000
So if you try to implement project on your side, you can do this as well.

305
00:19:23,000 --> 00:19:30,000
Okay, so now there are nine widgets which are not integrated and two images which are not integrated.

306
00:19:30,000 --> 00:19:35,000
So I will go to select files and then I will go to.

307
00:19:36,000 --> 00:19:38,000
Dataset and click on validation and then group.

308
00:19:38,000 --> 00:19:42,000
Now I'll upload all the images which are in the validation folder.

309
00:19:44,000 --> 00:19:47,000
Uh, so it might take some time.

310
00:19:47,000 --> 00:19:48,000
You can see that.

311
00:19:48,000 --> 00:19:51,000
But they will be uploaded over here.

312
00:19:53,000 --> 00:19:58,000
So after uploading these images, you can see that currently they are not annotated because I have not

313
00:19:58,000 --> 00:20:04,000
uploaded the labels file in the validation folder, so I will upload the labels file in the validation

314
00:20:04,000 --> 00:20:06,000
folder over here.

315
00:20:06,000 --> 00:20:09,000
So now this number will start to decrease a bit.

316
00:20:11,000 --> 00:20:11,000
Okay.

317
00:20:11,000 --> 00:20:17,000
So it's 125 now, but it will as we move on, this number will decrease.

318
00:20:17,000 --> 00:20:20,000
So it's 117 now it's 109 now.

319
00:20:20,000 --> 00:20:22,000
So this number will get gradually decreased.

320
00:20:22,000 --> 00:20:25,000
So please wait and watch.

321
00:20:25,000 --> 00:20:35,000
Now it's 101 now, so please see and it will start to decrease like 93 now and it's 85 now.

322
00:20:35,000 --> 00:20:41,000
So definitely as we move ahead, this number will decrease as the processing begins to complete.

323
00:20:43,000 --> 00:20:46,000
So like 76, similar to 69.

324
00:20:46,000 --> 00:20:54,000
So as we upload all the images over here, then I will click on Save and continue so that these images

325
00:20:54,000 --> 00:20:57,000
are uploaded into my into this project over here.

326
00:20:57,000 --> 00:21:02,000
And I can see that my dataset consists of 580 or 579 images.

327
00:21:03,000 --> 00:21:07,000
Only 45 images are left, which are not annotated.

328
00:21:08,000 --> 00:21:09,000
35 now.

329
00:21:10,000 --> 00:21:15,000
And it's it this the figure will be actually decreased like 28 now.

330
00:21:16,000 --> 00:21:16,000
And.

331
00:21:17,000 --> 00:21:19,000
You're 19 now, so.

332
00:21:20,000 --> 00:21:26,000
As we move ahead, this number will gradually decrease and writers never know which are not annotated.

333
00:21:26,000 --> 00:21:28,000
And now it's three.

334
00:21:28,000 --> 00:21:36,000
And so we can see that now all our dataset images are annotated and you can see over here and now I

335
00:21:36,000 --> 00:21:41,000
will click on Save and continue to upload my dataset images into this project.

336
00:21:41,000 --> 00:21:44,000
Okay, so I want to have a training.

337
00:21:44,000 --> 00:21:49,000
70% of the images in the training set, 20% of the images in the validation set and 10% of the images

338
00:21:49,000 --> 00:21:50,000
in the test set.

339
00:21:50,000 --> 00:21:54,000
So we can also rebalance it as per our requirement.

340
00:21:54,000 --> 00:22:01,000
But it is the standard practice to choose 70% of the images for the training, 20% for the validation

341
00:22:01,000 --> 00:22:02,000
and 10% for the test set.

342
00:22:02,000 --> 00:22:05,000
So I will select this and click on Continue.

343
00:22:06,000 --> 00:22:08,000
So after click and continue.

344
00:22:08,000 --> 00:22:11,000
Now all these files are being uploaded.

345
00:22:11,000 --> 00:22:17,000
It will take some time, so I will be back as this files get uploaded and then we will discuss further.

346
00:22:21,000 --> 00:22:23,000
Guys are on the dataset, images are uploaded.

347
00:22:23,000 --> 00:22:31,000
Now you can see here our dataset consists of 579 images and here is the training data images, here

348
00:22:31,000 --> 00:22:35,000
is the validation images and here is the test set images.

349
00:22:35,000 --> 00:22:42,000
And if I click on all classes, you can see that we have a book and pun and mark null.

350
00:22:42,000 --> 00:22:43,000
Class will be empty.

351
00:22:43,000 --> 00:22:50,000
Okay, so we have images for the book class, we have images for the and class as well for training,

352
00:22:50,000 --> 00:22:52,000
validation and test as well.

353
00:22:52,000 --> 00:22:53,000
Okay, guys.

354
00:22:53,000 --> 00:22:59,000
So now if I want to check the health of my dataset, I will click on health check and you can see that

355
00:22:59,000 --> 00:23:09,000
we have total 579 images and all the images contain the annotations plus total number of bounding boxes,

356
00:23:09,000 --> 00:23:16,000
or you can say annotations or labels in the in the 579 images are 2520.

357
00:23:16,000 --> 00:23:25,000
So it means that we have 2520 bounding boxes in total on 579 images.

358
00:23:25,000 --> 00:23:32,000
So in average, each image contains around 4 to 5 bounding boxes like you can see the 4.4 per images.

359
00:23:32,000 --> 00:23:37,000
So each images contain around 4 to 5 bounding boxes.

360
00:23:37,000 --> 00:23:40,000
Maybe two bounding boxes are of pen or two.

361
00:23:40,000 --> 00:23:42,000
Bounding boxes are of both.

362
00:23:42,000 --> 00:23:51,000
So in average, each image contain 4 to 5 bounding boxes and total we have 2520 bounding boxes on 579

363
00:23:51,000 --> 00:23:52,000
images.

364
00:23:52,000 --> 00:23:52,000
Okay.

365
00:23:52,000 --> 00:24:00,000
And our image size is 1024 cross 768 So in the pre-processing we will rescale our image size to six

366
00:24:00,000 --> 00:24:09,000
cross for cross 640 because our YOLO eight models are trained on 640 cross 640 images, so it will be

367
00:24:09,000 --> 00:24:16,000
better if we consider 640 cross 640 images in our dataset for training the model.

368
00:24:16,000 --> 00:24:18,000
So you can see the class balance.

369
00:24:18,000 --> 00:24:28,000
So our data is a bit imbalanced because out of 2500 bounding boxes on 579 images, 295 bounding boxes

370
00:24:28,000 --> 00:24:33,000
are of oak, while only 425 bounding boxes are of pen.

371
00:24:33,000 --> 00:24:39,000
Okay, so we have around three times four times more bounding boxes for book and then pen.

372
00:24:40,000 --> 00:24:40,000
Okay.

373
00:24:40,000 --> 00:24:45,000
So here is the annotation heatmap, like in for example, this is the image.

374
00:24:45,000 --> 00:24:49,000
So in this in the green or yellow region, we most usually have the bounding boxes.

375
00:24:50,000 --> 00:24:54,000
Like in blue region, we don't have bounding boxes while in green and yellow region which which they

376
00:24:54,000 --> 00:24:56,000
have the bounding boxes.

377
00:24:57,000 --> 00:25:01,000
Now I will go to generate and I have total 579 images.

378
00:25:01,000 --> 00:25:06,000
I have two classes, which is pen and book and all the images are aggregated.

379
00:25:06,000 --> 00:25:08,000
No images are aggregated in the training set.

380
00:25:08,000 --> 00:25:11,000
We have 405 images in the validation set.

381
00:25:11,000 --> 00:25:16,000
We have 116 images in the testing set, we have 58 images.

382
00:25:16,000 --> 00:25:24,000
So in the pre-processing step I will only resize the images to six cross 640 While there are other pre-processing

383
00:25:24,000 --> 00:25:30,000
steps as well, like you can grayscale the images or modify the class name like I can change the book

384
00:25:30,000 --> 00:25:37,000
name to the books or some other name, or you can change the pen name to ballpoint or some other name.

385
00:25:37,000 --> 00:25:37,000
Okay.

386
00:25:37,000 --> 00:25:38,000
So.

387
00:25:39,000 --> 00:25:46,000
While you can remove the null images if you have or you can change the contrast of the images as well,

388
00:25:46,000 --> 00:25:49,000
like you can make them more bright or dull as well.

389
00:25:49,000 --> 00:25:50,000
Okay.

390
00:25:50,000 --> 00:25:58,000
So I will only resize the images to 644 640 so if your dataset is low and you want to get good results

391
00:25:58,000 --> 00:26:00,000
so you can add augmentation steps.

392
00:26:00,000 --> 00:26:04,000
So using augmentation tab, you will increase the size of the dataset.

393
00:26:04,000 --> 00:26:07,000
For example, if you click on 90 degree rotate.

394
00:26:07,000 --> 00:26:14,000
So if I have 100 images in my dataset, so using 90 degree rotate now I will have 200 images in the

395
00:26:14,000 --> 00:26:21,000
dataset because it will create a sample of images of all the images which are 90 degree rotated and

396
00:26:21,000 --> 00:26:24,000
it will add them to my training dataset.

397
00:26:24,000 --> 00:26:32,000
So augmentation helps us to increase the size of our dataset, plus it also make our model more resilient.

398
00:26:32,000 --> 00:26:37,000
Okay, so there are a lot of augmentation steps which you can perform blood saturation you.

399
00:26:37,000 --> 00:26:43,000
So in the case where you have less amount of dataset using data augmentation, you can increase the

400
00:26:43,000 --> 00:26:44,000
size of your dataset.

401
00:26:45,000 --> 00:26:50,000
Now I will generate this dataset, click on Generate and now my dataset will be generated.

402
00:26:50,000 --> 00:26:54,000
So it might take some few seconds or few minutes.

403
00:26:54,000 --> 00:26:59,000
So let's wait until our dataset gets generated and then we will export.

404
00:26:59,000 --> 00:27:01,000
Okay, our dataset is generated.

405
00:27:01,000 --> 00:27:06,000
So using Roboflow, we can also train our model and see what results do we get.

406
00:27:06,000 --> 00:27:10,000
We can test our model on images or videos using Roboflow.

407
00:27:10,000 --> 00:27:11,000
It's a no code solution.

408
00:27:11,000 --> 00:27:14,000
You don't need to code anything, but I'll always like some code work.

409
00:27:14,000 --> 00:27:22,000
So I will click on export and basically I want to convert into YOLO v5 PyTorch format because YOLO V8

410
00:27:22,000 --> 00:27:27,000
and YOLO V5 have been has been released by ultralytics and both have the same format.

411
00:27:27,000 --> 00:27:33,000
So I will select Yolov5 PyTorch format to train my YOLO V8 model and click on continue.

412
00:27:35,000 --> 00:27:40,000
Now the file is zipping, so it might take some few seconds.

413
00:27:40,000 --> 00:27:48,000
Okay, so I will just copy this code from here and I will just paste this code into my CoLab notebook.

414
00:27:48,000 --> 00:27:53,000
So then I will train my model on YOLO model or this dataset.

415
00:27:53,000 --> 00:28:00,000
So let's discuss or implement that training process of YOLO model in the next part of the tutorial.

416
00:28:00,000 --> 00:28:01,000
See you there.

