1
00:00:02,000 --> 00:00:07,000
And now we will run it on webcam and see what results do we get.

2
00:00:07,000 --> 00:00:14,000
So I will just click over here and create a new directory by the name running YOLO.

3
00:00:15,000 --> 00:00:16,000
V8.

4
00:00:16,000 --> 00:00:17,000
Webcam.

5
00:00:17,000 --> 00:00:21,000
Okay, so now we will be running YOLO V8 on the webcam.

6
00:00:21,000 --> 00:00:24,000
So just create a new folder over here.

7
00:00:24,000 --> 00:00:25,000
Yolo.

8
00:00:27,000 --> 00:00:29,000
He end webcam dot pi.

9
00:00:30,000 --> 00:00:33,000
So I'm just created a new file over here.

10
00:00:33,000 --> 00:00:36,000
Yolo v8 webcam.py.

11
00:00:36,000 --> 00:00:38,000
And first of all, I will just write.

12
00:00:38,000 --> 00:00:40,000
Just close the previous ones.

13
00:00:41,000 --> 00:00:42,000
From Ultralytics.

14
00:00:44,000 --> 00:00:44,000
Import.

15
00:00:45,000 --> 00:00:46,000
Yolo.

16
00:00:47,000 --> 00:00:51,000
Okay, so we have just imported the YOLO V8 version over here.

17
00:00:53,000 --> 00:00:56,000
And I will write import cv2.

18
00:00:56,000 --> 00:00:58,000
Then I will just write import math.

19
00:00:58,000 --> 00:01:02,000
Over here will read.

20
00:01:03,000 --> 00:01:04,000
Currently just remove this.

21
00:01:04,000 --> 00:01:07,000
I will just explain this as we go further on.

22
00:01:08,000 --> 00:01:08,000
So.

23
00:01:08,000 --> 00:01:08,000
Okay.

24
00:01:10,000 --> 00:01:11,000
Then just right.

25
00:01:11,000 --> 00:01:15,000
App is equal to Cv2 dot videocapture.

26
00:01:16,000 --> 00:01:21,000
And just right as I just want to run YOLO on V8 on my webcam.

27
00:01:21,000 --> 00:01:23,000
So I will just write zero over here.

28
00:01:23,000 --> 00:01:29,000
But if you have multiple webcams or connected with your system, then you can just check which webcam

29
00:01:29,000 --> 00:01:30,000
are you using?

30
00:01:30,000 --> 00:01:32,000
It can be 1 or 0 in any case.

31
00:01:35,000 --> 00:01:38,000
Then I will just calculate the frame rate over here.

32
00:01:39,000 --> 00:01:39,000
It.

33
00:01:43,000 --> 00:01:46,000
Or to get the frame rate just right.

34
00:01:47,000 --> 00:01:51,000
And app dot get three.

35
00:01:51,000 --> 00:01:54,000
And to just get the frame height just right.

36
00:01:54,000 --> 00:01:58,000
Frame height is equal to end cap.

37
00:01:59,000 --> 00:02:01,000
Dot get four.

38
00:02:01,000 --> 00:02:05,000
So in this way we are just getting the frame width and the frame height.

39
00:02:09,000 --> 00:02:16,000
I just want to save the output video with detection I will just write out is equal to cv2.video writer.

40
00:02:22,000 --> 00:02:24,000
And just write a name.

41
00:02:24,000 --> 00:02:26,000
Output dot you.

42
00:02:26,000 --> 00:02:30,000
This is the name, uh, the name of my output file.

43
00:02:30,000 --> 00:02:38,000
Like after doing the detections or after doing detection on video or using webcam, the output video

44
00:02:38,000 --> 00:02:41,000
will be saved by the name output dot avi.

45
00:02:44,000 --> 00:02:52,000
I mean, we just write cv2.video writer dash for CC and.

46
00:02:54,000 --> 00:02:54,000
That's right.

47
00:02:57,000 --> 00:02:57,000
That's right.

48
00:02:57,000 --> 00:02:58,000
I'm over here.

49
00:02:59,000 --> 00:03:01,000
And Omar J.

50
00:03:02,000 --> 00:03:02,000
Omar.

51
00:03:04,000 --> 00:03:04,000
Anyway.

52
00:03:07,000 --> 00:03:08,000
Okay.

53
00:03:10,000 --> 00:03:19,000
Then just pass the frame rate over here and then just pass the frame rate and frame height over here.

54
00:03:19,000 --> 00:03:21,000
Okay, so just define my output.

55
00:03:21,000 --> 00:03:25,000
Video writer function over here using cv2.video writer.

56
00:03:25,000 --> 00:03:27,000
Then just click on enter.

57
00:03:30,000 --> 00:03:32,000
Just right model is equal to.

58
00:03:33,000 --> 00:03:35,000
Journal and.

59
00:03:37,000 --> 00:03:41,000
If I just go to the YOLO V it's for YOLO weights folder over here.

60
00:03:41,000 --> 00:03:46,000
You can see that here we have the YOLO V8 and our Pre-trained weights placed over here.

61
00:03:46,000 --> 00:03:50,000
So just write dot dot and just say that go to store.

62
00:03:50,000 --> 00:03:56,000
We just need to get out this out of this running YOLO V8 webcam folder and just need to go to the YOLO

63
00:03:56,000 --> 00:03:57,000
weights folder.

64
00:03:58,000 --> 00:04:00,000
So just write YOLO dash weights.

65
00:04:00,000 --> 00:04:01,000
Okay.

66
00:04:01,000 --> 00:04:06,000
And just write YOLO V8 and Dot over here.

67
00:04:06,000 --> 00:04:12,000
So here I'm just passing the Pre-trained weights path over here and just click on enter over here.

68
00:04:15,000 --> 00:04:15,000
Then just right.

69
00:04:16,000 --> 00:04:17,000
Wine through.

70
00:04:18,000 --> 00:04:19,000
Okay.

71
00:04:22,000 --> 00:04:24,000
Success is a common image.

72
00:04:27,000 --> 00:04:30,000
Is equal to cap dot read.

73
00:04:30,000 --> 00:04:32,000
So we are just.

74
00:04:34,000 --> 00:04:35,000
Reading frame by frame.

75
00:04:35,000 --> 00:04:36,000
Okay.

76
00:04:39,000 --> 00:04:41,000
Okay, so let's just test this.

77
00:04:41,000 --> 00:04:44,000
Either our webcam is working fine or is there an issue?

78
00:04:47,000 --> 00:04:50,000
Or just write CV two dot I am show.

79
00:04:52,000 --> 00:04:52,000
Image.

80
00:04:54,000 --> 00:05:02,000
My image over here and just write Cv2 dot, wait key over here and just click over here.

81
00:05:02,000 --> 00:05:05,000
One and I think.

82
00:05:06,000 --> 00:05:10,000
That's fine or just further elaborated.

83
00:05:10,000 --> 00:05:11,000
Cv2 dot Waitkey is one.

84
00:05:13,000 --> 00:05:13,000
And.

85
00:05:16,000 --> 00:05:17,000
Order is equal to.

86
00:05:19,000 --> 00:05:20,000
One then.

87
00:05:22,000 --> 00:05:22,000
Great.

88
00:05:22,000 --> 00:05:25,000
Okay, so that's completely fine.

89
00:05:32,000 --> 00:05:37,000
So let me just run it and see if I am able to access the webcam or not.

90
00:05:37,000 --> 00:05:40,000
And if I'm able to save the output video or not.

91
00:05:40,000 --> 00:05:45,000
So let's just click over here and click on Run YOLO V8 Webcam.

92
00:05:45,000 --> 00:05:46,000
Okay.

93
00:05:46,000 --> 00:05:53,000
So let me just I think it might take a few seconds for it to appear, so let's just wait.

94
00:05:54,000 --> 00:05:54,000
Okay.

95
00:05:56,000 --> 00:05:57,000
I don't think any other.

96
00:05:57,000 --> 00:05:58,000
Okay, let's just.

97
00:05:58,000 --> 00:06:00,000
Just navigate my screen over here.

98
00:06:00,000 --> 00:06:01,000
Just give me a minute.

99
00:06:01,000 --> 00:06:04,000
So now you can see over here the webcam is working fine.

100
00:06:04,000 --> 00:06:08,000
And now you can see by the image on your screens.

101
00:06:08,000 --> 00:06:12,000
Okay, So I think the webcam is working fine.

102
00:06:12,000 --> 00:06:16,000
Let's see if this output video is being saved into the directory or not.

103
00:06:16,000 --> 00:06:19,000
Okay, so let me just go back over here.

104
00:06:19,000 --> 00:06:19,000
Okay.

105
00:06:19,000 --> 00:06:25,000
So now you can see that here we have the output for file has been created over here.

106
00:06:25,000 --> 00:06:34,000
But let me just go back from here and just let me just pause, stop this process by just clicking over

107
00:06:34,000 --> 00:06:35,000
here.

108
00:06:35,000 --> 00:06:35,000
Okay.

109
00:06:35,000 --> 00:06:40,000
And let me just see if the output video is working or is there an issue.

110
00:06:40,000 --> 00:06:41,000
So just click over here.

111
00:06:42,000 --> 00:06:46,000
So now we can see that our output video is being saved.

112
00:06:46,000 --> 00:06:46,000
Okay.

113
00:06:46,000 --> 00:06:47,000
So now you can see that.

114
00:06:48,000 --> 00:06:53,000
Uh, as when we run the webcam, our video has been saved, so that's fine.

115
00:06:53,000 --> 00:06:54,000
That's perfectly fine.

116
00:06:55,000 --> 00:06:57,000
Okay, so let me just go back towards the code.

117
00:06:58,000 --> 00:06:59,000
For now.

118
00:06:59,000 --> 00:07:06,000
Now, I will just add the I'm not using the V8 model, which I've just called over here and just saved

119
00:07:06,000 --> 00:07:07,000
in the variable model.

120
00:07:08,000 --> 00:07:11,000
Now I will just run the detections on the live web feed.

121
00:07:11,000 --> 00:07:17,000
So let me just add that code over here and run detection on the live webcam feed as well.

122
00:07:20,000 --> 00:07:21,000
Read it.

123
00:07:21,000 --> 00:07:25,000
Well, here I have just written the complete code, so let me just explain you the complete code over

124
00:07:25,000 --> 00:07:26,000
here.

125
00:07:26,000 --> 00:07:33,000
So now here you can see that we are just doing the detections using YOLO V8 model on frame by frame.

126
00:07:33,000 --> 00:07:34,000
So here we have Stata.

127
00:07:34,000 --> 00:07:37,000
Stream is equal to true, so stream is equal to true.

128
00:07:37,000 --> 00:07:42,000
We'll use the generator and it is more efficient than the than if we just don't write stream is equal

129
00:07:42,000 --> 00:07:43,000
to true.

130
00:07:43,000 --> 00:07:43,000
Okay.

131
00:07:43,000 --> 00:07:49,000
So we are doing detection using YOLO v8 frame by frame and our result is are saved in this variable

132
00:07:49,000 --> 00:07:50,000
results.

133
00:07:50,000 --> 00:07:55,000
So once we have the results, we can check for individual bounding boxes and see how does it performs.

134
00:07:55,000 --> 00:08:00,000
So here you can see here, once we have the results, we can check for the individual bounding boxes

135
00:08:00,000 --> 00:08:02,000
and see how well it performs.

136
00:08:02,000 --> 00:08:10,000
So we will just look through each of the bounding boxes and for each of the result and see how how it

137
00:08:10,000 --> 00:08:11,000
detections are performing.

138
00:08:11,000 --> 00:08:12,000
Okay.

139
00:08:12,000 --> 00:08:16,000
So now you can see that here we are just looping through each of the individual bounding boxes.

140
00:08:17,000 --> 00:08:18,000
You can see over here.

141
00:08:18,000 --> 00:08:25,000
So here we have the X1Y1 coordinate of the bounding box and here we have the x2 and y2 coordinate of

142
00:08:25,000 --> 00:08:26,000
the bounding box.

143
00:08:26,000 --> 00:08:28,000
So let me just show you how it is.

144
00:08:28,000 --> 00:08:29,000
Basically it works.

145
00:08:29,000 --> 00:08:32,000
So let me just open the paint over here.

146
00:08:33,000 --> 00:08:33,000
Um.

147
00:08:33,000 --> 00:08:34,000
Okay.

148
00:08:34,000 --> 00:08:34,000
Just give me a minute.

149
00:08:35,000 --> 00:08:35,000
I'm just opening.

150
00:08:35,000 --> 00:08:35,000
Okay.

151
00:08:36,000 --> 00:08:38,000
So, for example, if we have this bounding box.

152
00:08:38,000 --> 00:08:44,000
Okay, so you can see here we have the four coordinates for each of the bounding box.

153
00:08:44,000 --> 00:08:45,000
Let me just write over here.

154
00:08:45,000 --> 00:08:47,000
So this is the x one.

155
00:08:48,000 --> 00:08:53,000
Y1 coordinate and this is the x2 and y2 coordinate.

156
00:08:53,000 --> 00:08:53,000
Okay.

157
00:08:53,000 --> 00:09:00,000
So for each of the bounding box we have the X1Y1 coordinate and this is the X2Y2 coordinate.

158
00:09:00,000 --> 00:09:09,000
So X1Y1 is the like you can see that at top left corner coordinate and this x2 y2 is the bottom right

159
00:09:09,000 --> 00:09:10,000
corner coordinate.

160
00:09:10,000 --> 00:09:10,000
Okay.

161
00:09:10,000 --> 00:09:13,000
So if you just go back towards the board again.

162
00:09:14,000 --> 00:09:20,000
Okay, so now you can see for each of the bounding box we have the x1, y1 and x2 y2 coordinates.

163
00:09:20,000 --> 00:09:22,000
Okay, that's perfectly fine.

164
00:09:22,000 --> 00:09:24,000
If we just go over here.

165
00:09:24,000 --> 00:09:28,000
So now you can see that we are just converting this coordinates values to integers.

166
00:09:28,000 --> 00:09:28,000
Why?

167
00:09:28,000 --> 00:09:31,000
We just need to convert this coordinate value to integers.

168
00:09:31,000 --> 00:09:35,000
Because the output which we are getting over here is in the form of tensors.

169
00:09:35,000 --> 00:09:37,000
We need to convert this output into integers.

170
00:09:37,000 --> 00:09:40,000
So let me just show you what kind of output we are getting.

171
00:09:40,000 --> 00:09:44,000
And after converting into integers, what kind of output do we get?

172
00:09:44,000 --> 00:09:49,000
So just run this from here and just let me just show you the output which we are getting.

173
00:09:51,000 --> 00:09:58,000
The webcam is just currently on, so might take a few seconds to just make the webcam working.

174
00:09:58,000 --> 00:09:58,000
So.

175
00:09:59,000 --> 00:09:59,000
Okay.

176
00:09:59,000 --> 00:10:05,000
So now you can see over here we have the output in the form of tensors by two further processes and

177
00:10:05,000 --> 00:10:07,000
create bounding boxes around the detected object.

178
00:10:07,000 --> 00:10:11,000
We need to convert this output from tensors into integers.

179
00:10:11,000 --> 00:10:14,000
So now we will just convert this output from the tensors into integers.

180
00:10:14,000 --> 00:10:18,000
So to convert this output from tensors into integers.

181
00:10:18,000 --> 00:10:23,000
So just comment this out from here and suggest you need to write int X1Y1.

182
00:10:23,000 --> 00:10:27,000
So we are just converting each of the coordinates from tensor into integer.

183
00:10:27,000 --> 00:10:32,000
So now just run this again and see what output do actually we get.

184
00:10:33,000 --> 00:10:39,000
So now basically our output is being converted from tensors into integers over here.

185
00:10:39,000 --> 00:10:43,000
So we will have the output very soon over here.

186
00:10:44,000 --> 00:10:45,000
Okay.

187
00:10:46,000 --> 00:10:49,000
So now you can see over here, now we have the output in the form of integers.

188
00:10:49,000 --> 00:10:52,000
So we can't see the tensors over here.

189
00:10:52,000 --> 00:10:55,000
So you can see that we have the output in the form of not integer.

190
00:10:55,000 --> 00:10:57,000
So let me just pause this down here.

191
00:10:57,000 --> 00:11:02,000
So now you can see that previously we have the tensors around each of the coordinate, but now we don't

192
00:11:02,000 --> 00:11:04,000
have the tensors around each of the coordinate.

193
00:11:04,000 --> 00:11:09,000
We have the output in the form of integer for zero are the X1Y1 coordinate value.

194
00:11:09,000 --> 00:11:11,000
This is the x one coordinate value.

195
00:11:11,000 --> 00:11:12,000
This is the y one.

196
00:11:12,000 --> 00:11:13,000
Coordinate value.

197
00:11:13,000 --> 00:11:16,000
This is the x two coordinate value and this is the y coordinate value.

198
00:11:16,000 --> 00:11:17,000
Okay.

199
00:11:18,000 --> 00:11:22,000
So now we just need to create a rectangle over here.

200
00:11:22,000 --> 00:11:27,000
So we use a or you can say that we need to create a bounding box around each of the directory object.

201
00:11:27,000 --> 00:11:33,000
So basically we have the coordinate value for each of the detected object, like we have the coordinates

202
00:11:33,000 --> 00:11:35,000
value for each of the detected object.

203
00:11:35,000 --> 00:11:39,000
We just need to create a rectangle around each of the detected object.

204
00:11:39,000 --> 00:11:43,000
So using cv2 dot rectangle, we will create a rectangle around each of the detected object.

205
00:11:45,000 --> 00:11:46,000
Okay.

206
00:11:46,000 --> 00:11:51,000
So if I just go over here and show you what are the parameters we have.

207
00:11:52,000 --> 00:11:53,000
CV to tango.

208
00:11:54,000 --> 00:11:55,000
Okay.

209
00:11:55,000 --> 00:11:56,000
So let me just open this from here.

210
00:11:57,000 --> 00:11:58,000
So.

211
00:12:00,000 --> 00:12:01,000
Okay.

212
00:12:01,000 --> 00:12:07,000
So now you can see over here in the rectangle we just passed the our image or the current frame.

213
00:12:07,000 --> 00:12:07,000
Okay.

214
00:12:08,000 --> 00:12:14,000
And then we have the starting point and then we have the ending point and the color of the rectangle.

215
00:12:14,000 --> 00:12:15,000
And then we have the thickness.

216
00:12:16,000 --> 00:12:16,000
Okay.

217
00:12:18,000 --> 00:12:21,000
So now you can see over here if you just see this.

218
00:12:21,000 --> 00:12:22,000
So this is our starting point.

219
00:12:23,000 --> 00:12:25,000
You can see over here, this is the ending point.

220
00:12:25,000 --> 00:12:30,000
And we will just define the color and the thickness of this bounding box.

221
00:12:30,000 --> 00:12:32,000
So if I just go back towards the code.

222
00:12:32,000 --> 00:12:38,000
So now you can see over here we have this is the current frame and this is our starting point.

223
00:12:38,000 --> 00:12:42,000
This is our ending point and this is the color of the bounding box.

224
00:12:42,000 --> 00:12:45,000
It's around pink and this is the thickness of the bounding box.

225
00:12:45,000 --> 00:12:45,000
Okay.

226
00:12:47,000 --> 00:12:50,000
So let me just comment this out currently.

227
00:12:50,000 --> 00:12:54,000
Let me just display the bounding boxes first and then we will discuss the.

228
00:12:55,000 --> 00:12:56,000
Okay.

229
00:12:56,000 --> 00:12:56,000
So.

230
00:12:58,000 --> 00:13:00,000
I am just currently focused on displaying the bounding box.

231
00:13:00,000 --> 00:13:03,000
I am not interesting in displaying anything else.

232
00:13:03,000 --> 00:13:10,000
Okay, so let me just display the bounding boxes and see what results do actually we get.

233
00:13:10,000 --> 00:13:16,000
Okay, so let me just just checking a few things over here.

234
00:13:16,000 --> 00:13:18,000
If there is an issue so I can just correct it.

235
00:13:18,000 --> 00:13:20,000
So let me just comment this out correctly as well.

236
00:13:22,000 --> 00:13:26,000
Okay, so let me just run this and see what what do we get?

237
00:13:26,000 --> 00:13:29,000
Are we able to draw bounding boxes around detected object or not?

238
00:13:29,000 --> 00:13:35,000
So currently our goal is to draw bounding boxes around each of the detected object and then we'll go

239
00:13:35,000 --> 00:13:36,000
ahead and see further work.

240
00:13:39,000 --> 00:13:43,000
Now you can see that a bounding box is being drawn around the as in a person.

241
00:13:43,000 --> 00:13:45,000
So a bounding box is are drawn around me.

242
00:13:46,000 --> 00:13:47,000
So that's perfectly fine.

243
00:13:47,000 --> 00:13:49,000
That's what we are expecting.

244
00:13:52,000 --> 00:13:55,000
You can see over here, a bounding box is being drawn around me.

245
00:13:55,000 --> 00:13:58,000
So this is the output which we expect.

246
00:13:58,000 --> 00:14:02,000
Basically, that bounding box should be drawn around each of the detected objects.

247
00:14:03,000 --> 00:14:09,000
Okay, so this is our server expectation, but now we just want to have the label and the confidence

248
00:14:09,000 --> 00:14:10,000
score as well.

249
00:14:11,000 --> 00:14:16,000
Like label means if a person there should be shown that I'm a person label above the bounding box,

250
00:14:16,000 --> 00:14:22,000
there should be a label that am person and the confidence score like how much our YOLO V8 model is confident

251
00:14:22,000 --> 00:14:23,000
that am a person.

252
00:14:25,000 --> 00:14:31,000
So I have already told you as our V8 model we are just using the V8 Pre-trained model which is trained

253
00:14:31,000 --> 00:14:32,000
on coco dataset.

254
00:14:32,000 --> 00:14:35,000
So the Coco dataset consists of 80 different classes.

255
00:14:35,000 --> 00:14:38,000
So I have just written the name of all those classes over here.

256
00:14:38,000 --> 00:14:43,000
These are all the classes which we have in the Coco dataset, which are around 80 different classes.

257
00:14:43,000 --> 00:14:44,000
Okay.

258
00:14:44,000 --> 00:14:49,000
So to get the confidence over over here, I'm just passing this using bad dot.

259
00:14:49,000 --> 00:14:52,000
See, we are just getting the confidence score values.

260
00:14:52,000 --> 00:14:55,000
The confidence score basically appears in the form of tensors.

261
00:14:55,000 --> 00:14:55,000
Okay.

262
00:14:55,000 --> 00:14:59,000
So to just convert into integer, I'm just using this math dot.

263
00:14:59,000 --> 00:15:03,000
See, let me show you what originally we have the confidence score value.

264
00:15:03,000 --> 00:15:09,000
So just write print box dot three sense, okay?

265
00:15:09,000 --> 00:15:14,000
And just write zero and let's see, what does the confidence score value do we get?

266
00:15:14,000 --> 00:15:17,000
So then we will discuss later, few things later.

267
00:15:17,000 --> 00:15:19,000
So just comment this out.

268
00:15:23,000 --> 00:15:26,000
We just don't want to show the output currently.

269
00:15:26,000 --> 00:15:28,000
I just want to show you the confidence score value.

270
00:15:28,000 --> 00:15:31,000
So just click on Run YOLO V8 Webcam.

271
00:15:36,000 --> 00:15:39,000
So now we'll have the confidence score value over here as well.

272
00:15:40,000 --> 00:15:43,000
So this might take a few seconds.

273
00:15:43,000 --> 00:15:45,000
So now you can see here.

274
00:15:46,000 --> 00:15:50,000
Okay, So just let me just stop this so you can see that we have the confidence score value in the form

275
00:15:50,000 --> 00:15:51,000
of tensors.

276
00:15:51,000 --> 00:15:54,000
We just need to convert this value into integers.

277
00:15:54,000 --> 00:15:58,000
So I'm just converting this value into integers over here.

278
00:15:58,000 --> 00:15:59,000
Okay.

279
00:16:00,000 --> 00:16:05,000
Thus now you can see over here we have the confidence pour value into it.

280
00:16:05,000 --> 00:16:11,000
We are just converting the confidence score value into integers and now using int box dot zero.

281
00:16:11,000 --> 00:16:13,000
We are just getting the class ID.

282
00:16:13,000 --> 00:16:14,000
Okay.

283
00:16:14,000 --> 00:16:20,000
So here will give us the class ID and here I've just written the class name.

284
00:16:20,000 --> 00:16:22,000
So if the class ID is zero, it means it is a person.

285
00:16:22,000 --> 00:16:25,000
If the class ID is one, it means it is a bicycle.

286
00:16:25,000 --> 00:16:28,000
And if the class ID is two, it means it is a car.

287
00:16:28,000 --> 00:16:34,000
Okay, so here I'm just getting the class ID and here I'm just finding the class name.

288
00:16:34,000 --> 00:16:38,000
And in the label I am just putting the class name and confidence value combined.

289
00:16:38,000 --> 00:16:42,000
And here I'm just finding using cv2 dot get text size function.

290
00:16:42,000 --> 00:16:49,000
I'm finding the size of this label so I can just create a rectangle with rectangle.

291
00:16:50,000 --> 00:16:52,000
Yes, but the size of this table.

292
00:16:54,000 --> 00:17:00,000
And here I'm just creating the rectangle above the bounding box so that I'm just can just put text around

293
00:17:00,000 --> 00:17:01,000
it.

294
00:17:01,000 --> 00:17:02,000
Okay.

295
00:17:02,000 --> 00:17:02,000
Okay.

296
00:17:02,000 --> 00:17:12,000
And just I'm just saving the my detections in the out in the file name as output.in this output dot

297
00:17:12,000 --> 00:17:12,000
file.

298
00:17:12,000 --> 00:17:14,000
My detections will be saved.

299
00:17:15,000 --> 00:17:19,000
And just let me just show you the reductions frame by frame, Right?

300
00:17:19,000 --> 00:17:26,000
And if I just click on one, the process will stop and just clicking auto release.

301
00:17:26,000 --> 00:17:29,000
So let's just run this and see what results do actually we get.

302
00:17:29,000 --> 00:17:32,000
And is our output saved or not?

303
00:17:32,000 --> 00:17:34,000
Or production video saved or not?

304
00:17:34,000 --> 00:17:39,000
So just run Yolo v webcam and see what results are we are getting now.

305
00:17:42,000 --> 00:17:45,000
Okay, so this might take a few seconds more.

306
00:17:51,000 --> 00:17:53,000
Mike can see that over here.

307
00:17:53,000 --> 00:17:58,000
The label person as well as you can see over here, the contents pour over here as well.

308
00:17:58,000 --> 00:18:01,000
Plus on the back side, I have the sofa so you can see that.

309
00:18:01,000 --> 00:18:02,000
So over here as well.

310
00:18:02,000 --> 00:18:06,000
Plus, you can see that a bounding box is created around me.

311
00:18:06,000 --> 00:18:09,000
And as I'm a person, so you can see the person over here.

312
00:18:09,000 --> 00:18:14,000
Plus on the back side, I can see the sofa and see the label soap over here as well.

313
00:18:15,000 --> 00:18:15,000
Okay.

314
00:18:15,000 --> 00:18:17,000
So let me just show all this.

315
00:18:18,000 --> 00:18:21,000
Can see that so far And.

316
00:18:26,000 --> 00:18:27,000
Now, the questions are very well.

317
00:18:27,000 --> 00:18:29,000
You can see over here.

318
00:18:29,000 --> 00:18:31,000
So these are the results which we expect.

319
00:18:31,000 --> 00:18:37,000
And this is all from this let me just show you, is our output video is saved or not?

320
00:18:39,000 --> 00:18:41,000
I'm just stopping this video.

321
00:18:41,000 --> 00:18:44,000
And let me show you if our output video is saved or not.

322
00:18:44,000 --> 00:18:49,000
So let me just go YOLO V8.

323
00:18:49,000 --> 00:18:50,000
Okay.

324
00:18:50,000 --> 00:18:55,000
So let me just go towards the YOLO V8 Crash course run, YOLO V8 Webcam.

325
00:18:55,000 --> 00:18:58,000
And so you can see over here, here we have the output video.

326
00:18:58,000 --> 00:19:04,000
So if I just click over here, okay, so now you can see that that's the results are very impressive.

327
00:19:04,000 --> 00:19:06,000
Our output is being saved.

328
00:19:06,000 --> 00:19:07,000
You can see over here.

329
00:19:08,000 --> 00:19:09,000
Okay, so.

330
00:19:10,000 --> 00:19:16,000
You can see that we are able to do the on the live webcam and our output video is saved there as well.

331
00:19:16,000 --> 00:19:18,000
So that's perfectly fine.

332
00:19:18,000 --> 00:19:23,000
That's the results which we am expecting and that's pretty impressive.

333
00:19:25,000 --> 00:19:26,000
So.

334
00:19:27,000 --> 00:19:32,000
The next video tutorial, we will run on Windows and see what results do we get.

