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 integrate object tracking with YOLO V8 segmentation.

3
00:00:09,000 --> 00:00:15,000
So in this video tutorial I will provide you a step by step guideline, so don't skip any part of the

4
00:00:15,000 --> 00:00:18,000
video and do watch the complete video.

5
00:00:18,000 --> 00:00:24,000
So for this project I will be using this GitHub repo YOLO V8 Segmentation Deepsort object tracking.

6
00:00:24,000 --> 00:00:28,000
So we will be implementing object tracking using Deepsort.

7
00:00:28,000 --> 00:00:34,000
So there are different object tracking algorithms which include sort strong sort nor fair and deep sort.

8
00:00:34,000 --> 00:00:38,000
So as far as my analysis, deep sort algorithm performs best.

9
00:00:38,000 --> 00:00:43,000
So in this project or in this tutorial, we will use Deepsort for the object tracking.

10
00:00:44,000 --> 00:00:44,000
Okay.

11
00:00:44,000 --> 00:00:48,000
So this is the YOLO segmentation Deepsort object tracking repo.

12
00:00:48,000 --> 00:00:56,000
So we will be using this GitHub repo in this tutorial, so I will explain you the complete code step

13
00:00:56,000 --> 00:00:56,000
by step.

14
00:00:56,000 --> 00:01:02,000
In the first step, I have just cloned the GitHub repo which you can do here by clicking on the code.

15
00:01:02,000 --> 00:01:06,000
Just copy this and just paste this over here and just.

16
00:01:06,000 --> 00:01:12,000
And in a simple way you can clone this GitHub repo from the GitHub into your Google CoLab notebook.

17
00:01:12,000 --> 00:01:16,000
So this is the complete CoLab file which we'll use in this tutorial.

18
00:01:16,000 --> 00:01:18,000
First, we will simply run the step.

19
00:01:18,000 --> 00:01:24,000
Then I will give you a detailed explanation of the predict.py file how we incorporate Deepsort algorithm

20
00:01:24,000 --> 00:01:29,000
Deepsort object tracking algorithm into the YOLO V8 segmentation script.

21
00:01:29,000 --> 00:01:31,000
So let's get started in the first step.

22
00:01:31,000 --> 00:01:36,000
Please make sure before running the script that you have selected the runtime as GPU.

23
00:01:37,000 --> 00:01:41,000
After selecting the runtime as GPU, then you need to clone the GitHub repo.

24
00:01:41,000 --> 00:01:47,000
So I'm just cloning this GitHub repo into my Google CoLab notebook over here.

25
00:01:47,000 --> 00:01:47,000
Okay.

26
00:01:47,000 --> 00:01:53,000
So in the next step you can see currently you will see that our current directory is being set that

27
00:01:53,000 --> 00:01:55,000
this project file section.

28
00:01:55,000 --> 00:02:00,000
But as we, we want to set the our current directory as this cloned folder.

29
00:02:00,000 --> 00:02:05,000
So you just need to go here copy path and just paste this path over here.

30
00:02:05,000 --> 00:02:09,000
So now this folder is being set as our current directory.

31
00:02:09,000 --> 00:02:10,000
Okay.

32
00:02:11,000 --> 00:02:18,000
So before we implement YOLO Deepsort Object tracking YOLO Segmentation with Deepsort Object tracking,

33
00:02:18,000 --> 00:02:22,000
we need to install all the required libraries that are required.

34
00:02:22,000 --> 00:02:25,000
Necessary or required to run this script successfully.

35
00:02:25,000 --> 00:02:27,000
So here we have the setup.py file.

36
00:02:27,000 --> 00:02:30,000
This contains all the required libraries.

37
00:02:30,000 --> 00:02:35,000
Or you can say the dependencies that are necessary to run this script successfully.

38
00:02:35,000 --> 00:02:39,000
So to think it's just taking a bit time to open.

39
00:02:39,000 --> 00:02:40,000
Okay, so.

40
00:02:42,000 --> 00:02:44,000
Now I will just install all the dependencies.

41
00:02:44,000 --> 00:02:49,000
So dependencies are basically the libraries that are necessary to run the scripts.

42
00:02:49,000 --> 00:02:56,000
So to install the dependencies, you just need to simply go over here and just run this cell.

43
00:02:56,000 --> 00:03:00,000
It will install all the required libraries that are necessary to run this script.

44
00:03:00,000 --> 00:03:01,000
Okay.

45
00:03:01,000 --> 00:03:05,000
So it might take few seconds, as you can see over here.

46
00:03:05,000 --> 00:03:11,000
So you can see that some libraries are required or preparing requirement already satisfied because some

47
00:03:11,000 --> 00:03:14,000
libraries are by default available in Google CoLab.

48
00:03:14,000 --> 00:03:22,000
While some libraries are not available by default in Google CoLab like classic Gtb, Omega confidence

49
00:03:22,000 --> 00:03:25,000
or other docs material.

50
00:03:25,000 --> 00:03:28,000
So these libraries are not available and they are being installed.

51
00:03:28,000 --> 00:03:33,000
So if you skip this step when you run the training validation or prediction.py script, you will definitely

52
00:03:33,000 --> 00:03:39,000
face the error that the following library is not installed, so it's always better to perform this step

53
00:03:39,000 --> 00:03:42,000
and install all the required libraries.

54
00:03:42,000 --> 00:03:47,000
Or you can say that dependencies that are necessary to run the script successfully.

55
00:03:48,000 --> 00:03:48,000
Okay.

56
00:03:48,000 --> 00:03:54,000
Then in the next step we will go to as we are doing the segmentation, I will go to ultralytics, Yolo

57
00:03:54,000 --> 00:03:55,000
V8.

58
00:03:55,000 --> 00:04:00,000
Then I will go to the segment this folder and set this as current folder.

59
00:04:00,000 --> 00:04:00,000
Okay.

60
00:04:00,000 --> 00:04:05,000
So what here I'm doing is setting the segmentation as my current folder because we are doing YOLO V8

61
00:04:05,000 --> 00:04:12,000
segmentation over here and here we have the training to train our YOLO V8 segmentation model on the

62
00:04:12,000 --> 00:04:18,000
custom data set to validate the YOLO V8 model, a trained YOLO V8 model.

63
00:04:18,000 --> 00:04:24,000
On the custom data set, we use validation bot.py to train validate the YOLO V8 model which is trained

64
00:04:24,000 --> 00:04:25,000
on the custom data set.

65
00:04:25,000 --> 00:04:32,000
Then we have the predict.py file to do the prediction on the pre-trained model on the fine tune YOLO

66
00:04:32,000 --> 00:04:36,000
v8 model, which is being fine tuned or trained on the custom data set.

67
00:04:36,000 --> 00:04:37,000
Okay, so.

68
00:04:38,000 --> 00:04:42,000
Nine dissecting this as my grand folder like grand directory.

69
00:04:42,000 --> 00:04:46,000
Now basically we are implementing object tracking using deepsort.

70
00:04:46,000 --> 00:04:52,000
So we need to download the Deepsort files or upload the Deepsort files to the segmentation folder.

71
00:04:52,000 --> 00:04:57,000
So I'm just downloading the Deepsort files from the Google drive in directly into my Google CoLab notebook.

72
00:04:57,000 --> 00:05:04,000
So here I'm just downloading the Deepsort files from the Google Drive into the Google CoLab notebook.

73
00:05:04,000 --> 00:05:08,000
So now you can see that Deepsort folder over here, but it is in the zip format.

74
00:05:08,000 --> 00:05:14,000
Next we will unzip this folder over here, so this might take a few seconds.

75
00:05:14,000 --> 00:05:15,000
Okay, So very quick.

76
00:05:15,000 --> 00:05:15,000
Okay.

77
00:05:15,000 --> 00:05:19,000
You can see now here we have the Deepsort complete folder over here.

78
00:05:19,000 --> 00:05:25,000
Here we have the all the required files which are required to integrate Deepsort object tracking with

79
00:05:25,000 --> 00:05:27,000
YOLO segmentation.

80
00:05:27,000 --> 00:05:33,000
Okay, so what object tracking is do object tracking assigns a unique ID object tracking.

81
00:05:33,000 --> 00:05:37,000
Simply assign a unique ID to each of the detected object.

82
00:05:37,000 --> 00:05:39,000
This is the purpose of object tracking.

83
00:05:39,000 --> 00:05:45,000
So using object tracking, we assign a unique ID to each of the detected object.

84
00:05:45,000 --> 00:05:52,000
Okay, so now I'm just downloading a sample video from the google drive over here so I can test my YOLO

85
00:05:52,000 --> 00:05:55,000
V8 segmentation model on that sample video.

86
00:05:55,000 --> 00:05:55,000
Okay.

87
00:05:55,000 --> 00:06:00,000
So here I'm just running the YOLO predict.py and YOLO V8 segmentation.

88
00:06:00,000 --> 00:06:03,000
This is the YOLO V8 test segmentation model.

89
00:06:03,000 --> 00:06:05,000
The pre-trained model am just the.

90
00:06:07,000 --> 00:06:11,000
Testing the YOLO VR segmentation model on a demo video which have downloaded from here.

91
00:06:11,000 --> 00:06:13,000
So just run this.

92
00:06:15,000 --> 00:06:20,000
Then we will see the output video and then I will explain you the predict.py file or the predict dot

93
00:06:20,000 --> 00:06:22,000
script in the predict.py file.

94
00:06:22,000 --> 00:06:23,000
And then we can.

95
00:06:24,000 --> 00:06:25,000
Proceed further.

96
00:06:28,000 --> 00:06:30,000
So this might take a few seconds.

97
00:06:32,000 --> 00:06:39,000
Yolo V8X dash segmentation is the most accurate model than other YOLO V8 models because so as we can

98
00:06:39,000 --> 00:06:45,000
say that Yolo V8X segmentation is more accurate, but it is less sparse than other YOLO V8 models,

99
00:06:45,000 --> 00:06:52,000
while Yolo v eight and segmentation is the most fastest model among the YOLO series, but it is less

100
00:06:52,000 --> 00:06:57,000
accurate by YOLO v8 X dash segmentation is more accurate, but it is less faster.

101
00:06:57,000 --> 00:07:04,000
So the update video is being divided into 190 frames and our model process each of the frame one by

102
00:07:04,000 --> 00:07:05,000
one.

103
00:07:05,000 --> 00:07:09,000
So the processing on the complete video is being done over here.

104
00:07:09,000 --> 00:07:11,000
So this might also take some time.

105
00:07:11,000 --> 00:07:13,000
So let's wait and see.

106
00:07:13,000 --> 00:07:14,000
What results do we get?

107
00:07:17,000 --> 00:07:19,000
Okay, so it's about complete.

108
00:07:19,000 --> 00:07:24,000
So our processing on the video is done and our results are being saved.

109
00:07:24,000 --> 00:07:27,000
As in this runs detect.

110
00:07:27,000 --> 00:07:27,000
Okay.

111
00:07:27,000 --> 00:07:30,000
So think YOLO segmentation.

112
00:07:30,000 --> 00:07:37,000
So in this runs detect train and here we have the our results file.

113
00:07:37,000 --> 00:07:39,000
So you just need to go over here.

114
00:07:39,000 --> 00:07:45,000
Simply set this path as this folder where you have the result output video over here and just run this

115
00:07:45,000 --> 00:07:49,000
cell and the output video will be displayed over here in visual over here.

116
00:07:50,000 --> 00:07:53,000
Segmentation with tracking will be implemented.

117
00:07:53,000 --> 00:07:53,000
Okay.

118
00:07:53,000 --> 00:07:57,000
So let me see, let's see what the output video we get.

119
00:07:57,000 --> 00:07:59,000
So this might take few seconds.

120
00:07:59,000 --> 00:08:04,000
So let's just wait for the output video to display over here.

121
00:08:07,000 --> 00:08:11,000
So here is our output video, which we can see in the Google CoLab notebook.

122
00:08:11,000 --> 00:08:15,000
We have displayed the output video into the Google CoLab notebook.

123
00:08:15,000 --> 00:08:20,000
So let me just download this video and show you what results do actually we get.

124
00:08:20,000 --> 00:08:24,000
So just navigate my screen towards this output demo video.

125
00:08:24,000 --> 00:08:26,000
So just give me a minute.

126
00:08:26,000 --> 00:08:27,000
Okay.

127
00:08:27,000 --> 00:08:30,000
So now in front of you you can see the output demo video.

128
00:08:30,000 --> 00:08:38,000
So you can see that we have Now let me just pause this video so you can see that each object or each

129
00:08:38,000 --> 00:08:43,000
person or you can say each object is being assigned a unique ID 82 over here plus.

130
00:08:43,000 --> 00:08:49,000
So in this way we have implemented, uh, or you can say integrated object tracking with YOLO V8 segmentation.

131
00:08:49,000 --> 00:08:52,000
Like you can see the mask over here and the bounding box.

132
00:08:52,000 --> 00:08:55,000
So YOLO V8 segmentation is being implemented.

133
00:08:55,000 --> 00:09:01,000
Plus you can see a unique ID with each of the detected object like 82 with this person 108 with that

134
00:09:01,000 --> 00:09:01,000
traffic light.

135
00:09:01,000 --> 00:09:03,000
Plus you can see these trails as well.

136
00:09:03,000 --> 00:09:10,000
Like you can see that this shows us what which path does the object or the person followed.

137
00:09:10,000 --> 00:09:15,000
So in this way we can see the path the person is following, so in which direction the person is coming

138
00:09:15,000 --> 00:09:18,000
from, which direction the person is coming.

139
00:09:18,000 --> 00:09:21,000
Okay, so in this way we can find the path the person is following.

140
00:09:21,000 --> 00:09:22,000
Okay?

141
00:09:22,000 --> 00:09:28,000
So you can see that using Deepsort object tracking, we are able to assign a unique ID each of the detected

142
00:09:28,000 --> 00:09:29,000
object.

143
00:09:29,000 --> 00:09:31,000
108 92 153 plus.

144
00:09:31,000 --> 00:09:37,000
We have also drawn the draw the trails as well which show the path the object has followed or the person

145
00:09:37,000 --> 00:09:38,000
has followed.

146
00:09:38,000 --> 00:09:46,000
So in a similar way, we can implement object tracking or integrate object tracking with YOLO segmentation.

147
00:09:47,000 --> 00:09:54,000
And we can test your segmentation with Deepsort object tracking on some other demo videos as well.

148
00:09:54,000 --> 00:09:57,000
Let's test on this demo video over here.

149
00:09:58,000 --> 00:10:04,000
Okay, so I'll just run this script and see what results do we get from this output video.

150
00:10:07,000 --> 00:10:10,000
So I'm just running the Yolo v eight Segmentation.

151
00:10:11,000 --> 00:10:15,000
Segmentation model on the S3 dot mp4 video.

152
00:10:15,000 --> 00:10:16,000
This is the Pre-trained model.

153
00:10:16,000 --> 00:10:23,000
You can also take the custom model and am just running the predict.py file and am its processing on

154
00:10:23,000 --> 00:10:27,000
the video so it has divided the complete video into 508 frames.

155
00:10:27,000 --> 00:10:34,000
You can see here and it's doing the processing on each of the frame one by one you can see over here

156
00:10:34,000 --> 00:10:35,000
and.

157
00:10:36,000 --> 00:10:43,000
So it's a two processing on 24 frames to 97 frames are done out of 588 frames.

158
00:10:43,000 --> 00:10:43,000
Okay.

159
00:10:43,000 --> 00:10:51,000
So here we are just testing a segmentation model on this demo video, which is test 3.4.

160
00:10:51,000 --> 00:10:51,000
Okay.

161
00:10:51,000 --> 00:10:54,000
So the processing on the video is almost done.

162
00:10:57,000 --> 00:11:02,000
I have already run this script previously as well, so it will not.

163
00:11:02,000 --> 00:11:06,000
So that's why you can see the output video over here as well.

164
00:11:06,000 --> 00:11:14,000
So our output video is saved in run detect train to test three dot MP4 is the name of our output video.

165
00:11:14,000 --> 00:11:16,000
Okay, so here is our output video.

166
00:11:16,000 --> 00:11:23,000
Let me just download it and show you what results do we get over here if I just run this cell again?

167
00:11:23,000 --> 00:11:24,000
So it might take very much time.

168
00:11:24,000 --> 00:11:29,000
So just to save the time, I'm just showing you the output video.

169
00:11:29,000 --> 00:11:32,000
So now you can see the output video in front of your screen.

170
00:11:32,000 --> 00:11:37,000
Let me just pause this video so you can see that each of detected object, like the car over here is

171
00:11:37,000 --> 00:11:41,000
being assigned a unique ID, one, ten, 11, six, eight.

172
00:11:41,000 --> 00:11:45,000
Plus we have this trails as well, which shows that the path object is following.

173
00:11:45,000 --> 00:11:51,000
So you can see this trails that you get from this trails, you can see that the car is coming in from

174
00:11:51,000 --> 00:11:53,000
this path and it's going straight.

175
00:11:53,000 --> 00:11:53,000
Okay.

176
00:11:53,000 --> 00:11:57,000
If the if it's following this, this, this, this, then the trails will be like this.

177
00:11:57,000 --> 00:11:58,000
Okay.

178
00:11:58,000 --> 00:12:01,000
So the trails show that what path the object is following.

179
00:12:01,000 --> 00:12:04,000
Plus we have the unique ID with the detected object.

180
00:12:04,000 --> 00:12:09,000
So in this way we have integrated the sort object tracking with YOLO V8 segmentation.

181
00:12:09,000 --> 00:12:12,000
Okay, so let's go back towards the code.

182
00:12:12,000 --> 00:12:17,000
If you want to run this complete video, you can see that it's done on each of the object, plus you

183
00:12:17,000 --> 00:12:19,000
can also see that.

184
00:12:20,000 --> 00:12:25,000
At the same detect objects like car have the same color of the bounding box as well as the mask.

185
00:12:25,000 --> 00:12:30,000
While different objects like truck as the different color of the bounding box as well as the mask.

186
00:12:30,000 --> 00:12:35,000
Okay, so you can see that here we have the directory red truck, although it's separated wrongly.

187
00:12:35,000 --> 00:12:37,000
It's not a truck, it's a car.

188
00:12:37,000 --> 00:12:40,000
But you can see here, the color of the mask is different.

189
00:12:40,000 --> 00:12:45,000
And color of the mask and bounding box are different than the car.

190
00:12:45,000 --> 00:12:45,000
Okay.

191
00:12:45,000 --> 00:12:49,000
For the car, we have the pink color of the and orange color of the mask.

192
00:12:49,000 --> 00:12:55,000
While you can see over here in the case of truck, we have the brown color of the bounding box and the

193
00:12:55,000 --> 00:12:57,000
brown color of the mask as well.

194
00:12:57,000 --> 00:12:59,000
So each object.

195
00:13:00,000 --> 00:13:06,000
So the object of the same same objects have the same color of the mosque and the same color of the bounding

196
00:13:06,000 --> 00:13:11,000
box, while different objects have the different color of the mosque and a different bounding box.

197
00:13:11,000 --> 00:13:17,000
So let's go back to our code and spend the rest of the code as well.

198
00:13:19,000 --> 00:13:23,000
So if you go back to the code and let me open the predict.py file over here.

199
00:13:23,000 --> 00:13:24,000
Okay.

200
00:13:24,000 --> 00:13:31,000
So in this predict.py file I have integrated the object deepsort object tracking code with the YOLO

201
00:13:31,000 --> 00:13:32,000
segmentation.

202
00:13:33,000 --> 00:13:33,000
Okay.

203
00:13:33,000 --> 00:13:40,000
So here you can see that i have just imported that deepsort from the deepsort pytorch folder.

204
00:13:40,000 --> 00:13:42,000
I have imported a deepsort module over here.

205
00:13:42,000 --> 00:13:48,000
You can see that Deepsort module is being imported from the Deepsort PyTorch folder over here.

206
00:13:48,000 --> 00:13:49,000
And then I am.

207
00:13:51,000 --> 00:13:55,000
Boring to get congregation files from the utils parser over here.

208
00:13:55,000 --> 00:13:58,000
So I'm just from this.py file.

209
00:13:58,000 --> 00:14:02,000
I'm quoting the get dash get dash configuration module.

210
00:14:03,000 --> 00:14:03,000
Okay.

211
00:14:03,000 --> 00:14:09,000
And here I'm just importing the deepsort module because we are implementing object tracking using deepsort.

212
00:14:09,000 --> 00:14:10,000
Okay.

213
00:14:10,000 --> 00:14:14,000
So here I've initialized the tracker deepsort object tracker over here you can see.

214
00:14:15,000 --> 00:14:20,000
Okay, so here we are, just converting the output received from the YOLO segmentation model into a

215
00:14:20,000 --> 00:14:27,000
format that is compatible with the YOLO V8 or that is compatible with the Deepsort object tracking.

216
00:14:27,000 --> 00:14:33,000
So here what we are doing is that we are converting the LB coordinates or you can see the output of

217
00:14:33,000 --> 00:14:41,000
the YOLO V8 segmentation model into a format which is compatible with Deepsort object tracking.

218
00:14:41,000 --> 00:14:48,000
So the output of the YOLO V8 segmentation model is being converted into a format that is compatible

219
00:14:48,000 --> 00:14:51,000
with Deepsort object tracking.

220
00:14:51,000 --> 00:14:54,000
Okay, so what basically we are doing is that.

221
00:14:55,000 --> 00:14:55,000
If.

222
00:14:55,000 --> 00:14:57,000
Open the paint file over here.

223
00:14:58,000 --> 00:14:58,000
Let me just.

224
00:14:58,000 --> 00:14:59,000
Give me a minute.

225
00:15:02,000 --> 00:15:03,000
Okay.

226
00:15:03,000 --> 00:15:05,000
So let me just navigate my screen over here.

227
00:15:05,000 --> 00:15:08,000
Okay, So now you can see this file.

228
00:15:08,000 --> 00:15:10,000
Let me just increase this file size.

229
00:15:10,000 --> 00:15:10,000
Okay.

230
00:15:10,000 --> 00:15:17,000
So you can see that if this is the bounding box output received from the YOLO V8 model.

231
00:15:17,000 --> 00:15:19,000
YOLO, V8 segmentation model.

232
00:15:19,000 --> 00:15:23,000
So in the YOLO V8 segmentation model, let me just write.

233
00:15:23,000 --> 00:15:25,000
We have this form of x.

234
00:15:25,000 --> 00:15:25,000
Y1Y.

235
00:15:25,000 --> 00:15:28,000
This is the this and this coordinate.

236
00:15:28,000 --> 00:15:31,000
And this is AX2Y2 coordinate.

237
00:15:31,000 --> 00:15:35,000
Okay, so what does YOLO V8 segmentation model does it.

238
00:15:35,000 --> 00:15:39,000
It converts these basically through YOLO V8 segmentation model.

239
00:15:39,000 --> 00:15:44,000
We get the output in the form of top left corner and the bottom right corner.

240
00:15:44,000 --> 00:15:45,000
So we get these four points.

241
00:15:45,000 --> 00:15:47,000
The first point is x one.

242
00:15:47,000 --> 00:15:51,000
The second point is Y one, the third is x two and the fourth is Y.

243
00:15:51,000 --> 00:15:57,000
So using YOLO V8 segmentation model, we get these four point as the output, but object YOLO.

244
00:15:58,000 --> 00:16:02,000
Deepsort object tracking requires the output in the form of XY.

245
00:16:02,000 --> 00:16:05,000
In Deepsort object tracking, we require the center coordinate.

246
00:16:06,000 --> 00:16:06,000
Okay.

247
00:16:06,000 --> 00:16:09,000
What is the center coordinate of the bounding box?

248
00:16:09,000 --> 00:16:10,000
Okay.

249
00:16:10,000 --> 00:16:13,000
Plus width and height of the bounding box.

250
00:16:13,000 --> 00:16:16,000
This is the height and this is the width of the bounding box.

251
00:16:16,000 --> 00:16:22,000
So in Deepsort object tracking, we required the center coordinate of the bounding box.

252
00:16:22,000 --> 00:16:23,000
Okay.

253
00:16:23,000 --> 00:16:25,000
And the width and the height of the bounding box.

254
00:16:25,000 --> 00:16:26,000
Okay.

255
00:16:26,000 --> 00:16:27,000
So.

256
00:16:28,000 --> 00:16:29,000
Using this function.

257
00:16:29,000 --> 00:16:34,000
Over here we convert the output received from the YOLO V8 model.

258
00:16:34,000 --> 00:16:39,000
YOLO segmentation model into a format that is compatible with the deep sword object tracking.

259
00:16:39,000 --> 00:16:46,000
Like we convert the x1, y1 x2 y2 coordinates into x, y, z center coordinates of the bounding box

260
00:16:46,000 --> 00:16:50,000
and the width and the height of the bounding box x, y, z.

261
00:16:50,000 --> 00:16:56,000
Present the center coordinates of the bounding box and the represent the height, width and height of

262
00:16:56,000 --> 00:16:57,000
the bounding box.

263
00:16:57,000 --> 00:17:00,000
So we are not using this function over here.

264
00:17:00,000 --> 00:17:00,000
Plus we are.

265
00:17:00,000 --> 00:17:06,000
What we are saying is that if the label is a person, then assign the bounding box mass and the label

266
00:17:06,000 --> 00:17:07,000
this color.

267
00:17:07,000 --> 00:17:12,000
If the label is cat, then assign the bounding box mass this color.

268
00:17:12,000 --> 00:17:14,000
So we are just defining the color and.

269
00:17:16,000 --> 00:17:23,000
And here we have created the Xbox One and Xbox function is used to create a bounding box around the

270
00:17:23,000 --> 00:17:24,000
detecting object.

271
00:17:24,000 --> 00:17:30,000
So using Cv2 dot rectangle, I'm creating a bounding box around the detected object and using this dot

272
00:17:30,000 --> 00:17:38,000
rectangle, I'm just creating a rectangle above the bounding box so I can put the label text over here.

273
00:17:38,000 --> 00:17:40,000
Like this is the person, this is the car over here.

274
00:17:40,000 --> 00:17:46,000
Okay, now we have the draw boxes function in draw dash boxes function we call the dash box function.

275
00:17:46,000 --> 00:17:47,000
Okay.

276
00:17:47,000 --> 00:17:51,000
And we also implement a deep sword object tracking in this function as well.

277
00:17:51,000 --> 00:17:52,000
Okay.

278
00:17:52,000 --> 00:17:57,000
So you can see that here we are assigning a unique ID to each of the detected object over here.

279
00:17:57,000 --> 00:17:57,000
Okay.

280
00:17:57,000 --> 00:18:06,000
So in data decoded in this data.id, that attitude ID is basically and this is a dictionary in data

281
00:18:07,000 --> 00:18:08,000
you we are just.

282
00:18:09,000 --> 00:18:14,000
Sorting the center coordinates of the bounding box for center coordinates of the bottom of the bounding

283
00:18:14,000 --> 00:18:15,000
box over here.

284
00:18:15,000 --> 00:18:22,000
And then I'm just calling the box function so that I can draw the rectangle around the so I can draw

285
00:18:22,000 --> 00:18:29,000
the bounding box around the object and assign or also draw the rectangle to add the label as well.

286
00:18:29,000 --> 00:18:29,000
Okay.

287
00:18:29,000 --> 00:18:33,000
Then using this function using cv2 dot line, I am drawing that trails.

288
00:18:33,000 --> 00:18:34,000
Okay.

289
00:18:34,000 --> 00:18:36,000
So I have already told you what are the trails?

290
00:18:36,000 --> 00:18:38,000
So these are the trails.

291
00:18:38,000 --> 00:18:39,000
The pink line.

292
00:18:39,000 --> 00:18:41,000
You can see over here the pink line.

293
00:18:41,000 --> 00:18:42,000
You can see over here.

294
00:18:42,000 --> 00:18:42,000
These are the trails.

295
00:18:42,000 --> 00:18:47,000
So using cv2 dot line, I'm just drawing that trails over here as well.

296
00:18:47,000 --> 00:18:53,000
Okay, then here I'm just incrementing the segmentation, creating a mask around the detected object.

297
00:18:53,000 --> 00:18:54,000
Okay.

298
00:18:54,000 --> 00:18:59,000
And here I'm just incrementing the deepsort with the object tracking as well.

299
00:18:59,000 --> 00:18:59,000
Okay.

300
00:18:59,000 --> 00:19:06,000
And I'm just calling the draw dash boxes function created above to implement the segmentation with deepsort

301
00:19:06,000 --> 00:19:07,000
object tracking.

302
00:19:07,000 --> 00:19:10,000
YOLO segmentation with Deepsort object tracking.

303
00:19:10,000 --> 00:19:12,000
So that's all from this video tutorial.

304
00:19:12,000 --> 00:19:13,000
See you all in the next video tutorial.

305
00:19:13,000 --> 00:19:15,000
Till then, bye bye.

