1
00:00:02,450 --> 00:00:10,580
In this tutorial, we will learn how we can do object tracking using YOLO v9 and sort algorithm for

2
00:00:10,580 --> 00:00:11,660
object detection.

3
00:00:11,660 --> 00:00:18,830
I will be using the Yolo v9 algorithm and to track each of the detected object I will be using the sort

4
00:00:18,830 --> 00:00:19,910
algorithm.

5
00:00:19,910 --> 00:00:21,740
So let's get started with it.

6
00:00:21,740 --> 00:00:27,860
Over here you can see that I have created a new project by the name Yolo v nine sort recording, and

7
00:00:27,860 --> 00:00:33,620
I have just created this project in my local directory, uh, in my local directory so you can create

8
00:00:33,620 --> 00:00:39,470
a project, uh, new project in any of your local directory as well, using PyCharm or any other IDE

9
00:00:39,500 --> 00:00:40,250
as well.

10
00:00:40,250 --> 00:00:46,250
So I have listed all the steps which I will be following in this tutorial in this notepad.

11
00:00:46,250 --> 00:00:51,110
So over here in the step number one we will clone the Yolo v nine GitHub repo.

12
00:00:51,110 --> 00:00:54,800
So I will just go over here in the browser.

13
00:00:54,800 --> 00:00:57,440
So here you can see the Yolo v nine GitHub repo.

14
00:00:57,440 --> 00:01:02,870
So to clone it I will just click over here and copy the URL to the clipboard.

15
00:01:02,870 --> 00:01:03,230
Okay.

16
00:01:03,230 --> 00:01:04,340
So now it's copied.

17
00:01:04,340 --> 00:01:07,580
And now I will just go back to the PyCharm from here.

18
00:01:07,580 --> 00:01:11,930
And I will just open the terminal terminal over here.

19
00:01:11,930 --> 00:01:18,530
And to clone this complete repo GitHub repo into my this into this project yolo v nine sort recording

20
00:01:18,530 --> 00:01:20,330
I will just write it clone.

21
00:01:21,600 --> 00:01:25,500
And I will add the URL of the benign repo over here.

22
00:01:25,500 --> 00:01:29,550
So now you can see that the cloning has started and it's completed.

23
00:01:29,550 --> 00:01:33,510
So now I will if I just refresh this over here.

24
00:01:34,760 --> 00:01:35,900
Okay okay.

25
00:01:35,900 --> 00:01:37,160
So no no need to refresh.

26
00:01:37,160 --> 00:01:39,380
We have this yolo v nine wrapper over here.

27
00:01:39,380 --> 00:01:45,950
So now I will just set this yolo v9 wrapper which have cloned into my project as my current directory.

28
00:01:45,950 --> 00:01:49,130
So I will just set this YOLO v nine folder as my current directory.

29
00:01:49,130 --> 00:01:52,310
And you can see we have all the files over here as well.

30
00:01:52,310 --> 00:01:57,650
So to set this as YOLO benign folder as my current directory I will write CD which stands for current

31
00:01:57,650 --> 00:02:00,500
directory and I will just write YOLO v nine over here.

32
00:02:00,500 --> 00:02:04,430
So this YOLO v nine folder is being set as my current directory.

33
00:02:04,430 --> 00:02:09,950
So in the step number one uh we need to install all the required packages.

34
00:02:09,950 --> 00:02:16,730
So over here in the requirements.txt file you can find all the required packages that are required to

35
00:02:16,730 --> 00:02:17,480
run this.

36
00:02:18,820 --> 00:02:21,670
Uh, to run that detection and tracking script successfully.

37
00:02:21,670 --> 00:02:28,510
So which include OpenCV, Python, matplotlib, NumPy, SciPy, Torchvision, Tqdm and pandas, TensorFlow,

38
00:02:28,510 --> 00:02:33,880
js and all the required packages are listed over here, so these packages are required to run the detection

39
00:02:33,880 --> 00:02:35,800
and tracking script successfully.

40
00:02:35,800 --> 00:02:40,330
Or if you want to train your object detection model on any custom data set, you need to install all

41
00:02:40,330 --> 00:02:43,570
these packages so we can install all these packages one by one.

42
00:02:43,570 --> 00:02:46,990
Or there is another way we can do which is quite easy way.

43
00:02:46,990 --> 00:02:51,760
So you can just write over here pip install minus r.

44
00:02:52,980 --> 00:02:54,090
Required.

45
00:02:55,230 --> 00:02:56,640
Men's dot txt.

46
00:02:56,670 --> 00:03:03,360
So when you write pip install r requirements.txt it is basically install all the packages that are required

47
00:03:03,360 --> 00:03:05,250
listed in the requirements.txt file.

48
00:03:05,340 --> 00:03:10,020
So it will install all these packages that are listed in this requirements.txt file.

49
00:03:10,020 --> 00:03:12,240
So I will just click on enter from here.

50
00:03:12,240 --> 00:03:17,340
And now all the packages that are listed inside the requirements.txt file will get installed.

51
00:03:29,700 --> 00:03:34,500
So this might take a few more seconds for the process to get completed and all these packages to get

52
00:03:34,500 --> 00:03:34,980
installed.

53
00:03:34,980 --> 00:03:39,030
You can see that the packages installation is currently in progress.

54
00:03:43,120 --> 00:03:47,740
Now you can see over here all the required packages are being installed successfully.

55
00:03:47,770 --> 00:03:49,870
Next if I just open this up.

56
00:03:49,870 --> 00:03:55,270
So now we need to download a sample video from the Google Drive link below, or download a sample image

57
00:03:55,270 --> 00:03:56,440
from the Google Drive link below.

58
00:03:56,440 --> 00:03:58,780
So I will just copy this link from here.

59
00:03:59,050 --> 00:04:06,430
So to download any image or a video from the Google Drive link, we need to install the G down uh library

60
00:04:06,430 --> 00:04:06,910
as well.

61
00:04:06,910 --> 00:04:09,340
So first I will install the G down library.

62
00:04:09,730 --> 00:04:12,070
So I will just write pip install g down.

63
00:04:12,070 --> 00:04:13,780
So this will install this package.

64
00:04:13,780 --> 00:04:20,770
So this help us to download uh any video image or any file from the or any zip file or any other file

65
00:04:20,770 --> 00:04:26,410
from the Google drive directly into this, our local IDE, or either in Google Colab, notebook, Jupyter

66
00:04:26,410 --> 00:04:29,920
Notebook, Visual Studio or PyCharm or any other IDE as well.

67
00:04:29,920 --> 00:04:32,830
So g down stand for Google Drive download.

68
00:04:32,860 --> 00:04:39,640
I like this thing, so I will just uh, plus I will add this up in the requirements.txt file as well.

69
00:04:39,640 --> 00:04:43,780
So in any case, when you install the requirements dot txt file.

70
00:04:43,780 --> 00:04:47,320
So this package also gets stored along with this as well.

71
00:04:47,320 --> 00:04:49,240
So I g down here as well.

72
00:04:51,110 --> 00:04:51,590
Okay.

73
00:04:51,590 --> 00:04:58,160
So next I will just open this up, copy this link, and I will just add this link over here and click

74
00:04:58,160 --> 00:04:58,730
on enter.

75
00:04:58,730 --> 00:05:04,160
So this will download a sample image from the drive into this our project.

76
00:05:04,160 --> 00:05:06,200
So over here image one dot jpg.

77
00:05:06,200 --> 00:05:07,910
So if I let me see.

78
00:05:07,910 --> 00:05:11,630
So here you can see we have the image one dot jpg get installed.

79
00:05:11,630 --> 00:05:12,710
So.

80
00:05:16,180 --> 00:05:19,270
Next, we need to download sample videos from the Google Drive link below.

81
00:05:19,270 --> 00:05:23,170
So first I will just copy this Google Drive link and enter.

82
00:05:23,170 --> 00:05:27,640
So this will download a video from the drive into this PyCharm IDE.

83
00:05:31,350 --> 00:05:35,220
So test dot mp4 is the name of the demo video.

84
00:05:35,250 --> 00:05:36,840
So over here you can see.

85
00:05:37,900 --> 00:05:43,030
We have the test walked MP4 video over here next if I just go over here.

86
00:05:43,030 --> 00:05:46,930
So when you install the second demo video over here.

87
00:05:46,930 --> 00:05:49,150
So I will just add this link over here.

88
00:05:52,240 --> 00:05:55,480
So this will take a few more seconds before we have it.

89
00:05:55,510 --> 00:05:58,090
So now you can see we have the test three dot mp4.

90
00:05:58,120 --> 00:05:59,650
This is the other demo video.

91
00:05:59,650 --> 00:06:03,130
And if I just refresh this up here.

92
00:06:05,610 --> 00:06:09,450
So you can see here we have test three dot mp4 test dot mp4.

93
00:06:09,450 --> 00:06:15,090
So we have uh downloaded the sample image and sample videos from the Google Drive directly into this

94
00:06:15,090 --> 00:06:17,010
PyCharm IDE as well.

95
00:06:17,010 --> 00:06:19,320
So that's been done successfully.

96
00:06:19,320 --> 00:06:24,390
So download the sample image, download the sample videos from Google Drive link below.

97
00:06:24,390 --> 00:06:26,850
So now we need to do object detection on image.

98
00:06:26,850 --> 00:06:30,870
So as we uh first uh to do object detection on image.

99
00:06:30,870 --> 00:06:35,490
So you just need to go into this yolo v nine GitHub repo over here.

100
00:06:35,640 --> 00:06:38,940
Uh you will check the releases version 0.1.

101
00:06:38,940 --> 00:06:42,930
And over here you will see the model weights file over here.

102
00:06:42,930 --> 00:06:44,850
So you can just click over here.

103
00:06:44,850 --> 00:06:47,010
And the model weights file will be downloaded.

104
00:06:47,010 --> 00:06:49,470
So if you just click over here.

105
00:06:50,890 --> 00:06:52,630
So this will download the model weights.

106
00:06:52,750 --> 00:06:58,240
So I will just cancel this out because I have already have downloaded the model weights.

107
00:06:58,240 --> 00:06:59,740
And let me show you.

108
00:06:59,740 --> 00:07:04,840
So over here you can see over here we are the model weights.

109
00:07:05,020 --> 00:07:07,630
So here you can see we have the model weights.

110
00:07:07,630 --> 00:07:08,680
So.

111
00:07:11,720 --> 00:07:18,890
Copy this file name over here, and I will just go into my project over here, and I will just add the

112
00:07:18,890 --> 00:07:20,720
weights file over here as well.

113
00:07:20,720 --> 00:07:23,750
So you can see we have the model weights over here.

114
00:07:24,200 --> 00:07:25,760
So that's been done.

115
00:07:26,150 --> 00:07:29,570
So next we will just go to the code from here.

116
00:07:30,800 --> 00:07:32,150
And over here.

117
00:07:32,150 --> 00:07:35,330
So if you just go below down below.

118
00:07:35,330 --> 00:07:40,670
So to do inference with YOLO v nine, like if you want to do object detection on image with yolo v nine,

119
00:07:40,940 --> 00:07:46,100
uh, by using the pre-trained model weights, you will we will using detect test.py script file and

120
00:07:46,100 --> 00:07:47,960
in the source will pass the image path.

121
00:07:47,960 --> 00:07:51,740
And then we have the pre-trained model weights over here.

122
00:07:51,740 --> 00:07:52,730
So that's all.

123
00:07:52,730 --> 00:07:55,550
So I will just go over here.

124
00:07:57,390 --> 00:07:59,310
I will just write Python.

125
00:08:00,340 --> 00:08:02,590
You take that dashed.py.

126
00:08:02,590 --> 00:08:06,430
So here we have the detect-dual.py file.

127
00:08:06,580 --> 00:08:14,770
And then we have the source as image one dot jpg okay.

128
00:08:14,770 --> 00:08:17,590
And then we have the weights as.

129
00:08:18,410 --> 00:08:23,270
Yolo b9 that c dot b2.

130
00:08:23,480 --> 00:08:26,810
So you can see here we have the your weights file over here.

131
00:08:26,810 --> 00:08:29,480
Here we have the input image file over here.

132
00:08:29,480 --> 00:08:31,580
And if I just show you the input image.

133
00:08:31,580 --> 00:08:32,750
So this is our input image.

134
00:08:32,750 --> 00:08:35,780
And we will be doing object detection on this input image.

135
00:08:36,550 --> 00:08:37,030
Okay.

136
00:08:37,030 --> 00:08:41,350
Plus I don't have the GPU in my local system, so I will be using CPU.

137
00:08:41,350 --> 00:08:45,340
So device, CPU and um, anything else.

138
00:08:45,340 --> 00:08:48,100
So I want to see the output image.

139
00:08:48,100 --> 00:08:50,140
So I will just write dash dash view image.

140
00:08:50,140 --> 00:08:53,200
Plus I will just put it-dual.py.

141
00:08:53,200 --> 00:08:56,200
And I will just make one change in the code.

142
00:08:59,040 --> 00:09:01,980
I will just change it to zero.

143
00:09:01,980 --> 00:09:07,110
So the output will be image will be displayed for infinite time if I just write one.

144
00:09:07,110 --> 00:09:12,000
So the output image will be displayed for one millisecond, which is very small and we will not be able

145
00:09:12,000 --> 00:09:13,020
to see the results.

146
00:09:13,020 --> 00:09:16,020
So now it will be displayed for infinite time.

147
00:09:16,020 --> 00:09:18,960
Okay, so let's run this up now.

148
00:09:20,070 --> 00:09:21,780
I hope it will work fine.

149
00:09:21,780 --> 00:09:26,250
But if in any case, in theory, if there is any error, we will try to fix this up.

150
00:09:26,990 --> 00:09:31,400
So now we are doing object detection on this input image.

151
00:09:31,580 --> 00:09:32,930
Image one dot jpg.

152
00:09:33,080 --> 00:09:37,670
And let's see whether we are able to detect different objects inside this image or not.

153
00:09:39,430 --> 00:09:42,520
I'm using CPU so this will take some time.

154
00:09:42,520 --> 00:09:48,280
Like with GPU, the inference will be very fast, but with GPU the but with CPU the inference is very

155
00:09:48,280 --> 00:09:48,700
slow.

156
00:09:48,700 --> 00:09:53,260
So over here you can see that we are able to detect burst persons or traffic lights.

157
00:09:53,260 --> 00:09:56,320
Like you can see the persons are bit far away and very blurred.

158
00:09:56,320 --> 00:09:58,960
But the Yolov5 model is able to detect successfully.

159
00:09:58,960 --> 00:10:02,020
We are able to like bicycle backpack, hand bags.

160
00:10:02,170 --> 00:10:04,930
So the results look quite impressive from here.

161
00:10:05,140 --> 00:10:05,710
Okay.

162
00:10:05,710 --> 00:10:07,390
And bag is also detected.

163
00:10:07,390 --> 00:10:08,620
So.

164
00:10:09,490 --> 00:10:13,720
Okay, so if you can press any key, the, uh, it will the script will close up and the output image

165
00:10:13,720 --> 00:10:14,920
will also be closed.

166
00:10:15,220 --> 00:10:21,070
So next we will see how we can do, uh, object detection on a video.

167
00:10:21,070 --> 00:10:21,580
So.

168
00:10:22,570 --> 00:10:24,730
Let's make it to one again.

169
00:10:24,730 --> 00:10:27,490
So each frame will be displayed for one millisecond.

170
00:10:27,490 --> 00:10:32,680
And over here I will just add the path for the video.

171
00:10:32,680 --> 00:10:34,870
So over here I will just write.

172
00:10:34,960 --> 00:10:35,350
Um.

173
00:10:36,710 --> 00:10:40,160
Best free DAW MP.

174
00:10:41,880 --> 00:10:47,040
So now we'll be doing object detection on this street MP4 video.

175
00:10:47,040 --> 00:10:49,350
And let's see how does it goes.

176
00:10:50,780 --> 00:10:53,120
So we have done object detection on video.

177
00:10:53,120 --> 00:10:55,790
We have done now we are doing object detection on.

178
00:10:55,790 --> 00:10:57,530
We have done object detection on image.

179
00:10:57,530 --> 00:10:59,810
Now we are doing object detection on video.

180
00:10:59,810 --> 00:11:04,580
And next we will be doing object detection object tracking using yolo v9 and sort algorithm.

181
00:11:04,670 --> 00:11:08,330
So currently we are doing object detection on video.

182
00:11:09,920 --> 00:11:10,070
Okay.

183
00:11:10,070 --> 00:11:10,730
So.

184
00:11:11,090 --> 00:11:11,330
So.

185
00:11:13,180 --> 00:11:13,630
Okay.

186
00:11:14,200 --> 00:11:17,800
So over here you can see that we are able to detect the cars.

187
00:11:18,160 --> 00:11:19,930
Uh, so these are the false positives.

188
00:11:19,930 --> 00:11:21,250
This is the false positive.

189
00:11:21,250 --> 00:11:24,280
And here you can see that we are able to detect the cars.

190
00:11:24,310 --> 00:11:29,590
So here you can see we are also able to detect the cars as well.

191
00:11:29,650 --> 00:11:34,360
So the detection is very slow because we are running it on CPU machine.

192
00:11:34,360 --> 00:11:38,140
But if you use GPU the detections uh the frame rate will be very high.

193
00:11:38,170 --> 00:11:40,090
Currently the frame rates are very low.

194
00:11:40,180 --> 00:11:45,880
Uh, but if you test it on GPU, the frame rate will be around 5 to 6 fps frame per second.

195
00:11:45,880 --> 00:11:49,720
But I'm testing on CPU so the frame rate is very low.

196
00:11:51,590 --> 00:11:55,310
But you can see over here we are able to track the cars very successfully.

197
00:11:55,310 --> 00:11:56,630
And these three.

198
00:11:56,750 --> 00:11:59,150
And this truck is pos positive.

199
00:12:04,030 --> 00:12:08,110
So false positive means like there is no car, but it's detecting the car.

200
00:12:08,110 --> 00:12:10,060
So this is a false positive prediction.

201
00:12:10,150 --> 00:12:15,520
Like there doesn't exist any car over here and there doesn't exist any truck, but it's returning as

202
00:12:15,520 --> 00:12:15,820
a truck.

203
00:12:15,820 --> 00:12:18,730
So this is a false positive okay.

204
00:12:18,730 --> 00:12:23,260
So like in this way you can test on the video as well.

205
00:12:23,260 --> 00:12:26,650
So if I just press control C so this will interrupt this process.

206
00:12:26,650 --> 00:12:29,920
So now we have done object detection on image.

207
00:12:29,920 --> 00:12:31,720
We have done object detection on video.

208
00:12:31,720 --> 00:12:36,430
Let's move on and see how we can do object tracking using the Sort algorithm.

209
00:12:36,430 --> 00:12:41,230
So if you just go over here and if you just uh right on Google.

210
00:12:41,230 --> 00:12:42,850
So if let me just show you.

211
00:12:43,550 --> 00:12:44,960
So on GitHub.

212
00:12:45,380 --> 00:12:47,630
So you just need to open the.

213
00:12:48,630 --> 00:12:49,290
This first link.

214
00:12:49,290 --> 00:12:55,500
So sort stand for simple online real time tracking of multiple objects in a video sequence.

215
00:12:55,680 --> 00:12:58,260
Okay, so you just need this sort.py file.

216
00:13:00,050 --> 00:13:02,150
So here we have the saw.py file.

217
00:13:02,150 --> 00:13:05,360
So if you just can download this this file will be downloaded.

218
00:13:05,360 --> 00:13:08,750
But I have made some changes into the saw.py file.

219
00:13:08,930 --> 00:13:15,050
So if you use this by default saw.py board you will be in the output of.

220
00:13:15,080 --> 00:13:20,960
If you use this saw.py board in the output, you will be getting the bounding box coordinates and the

221
00:13:20,960 --> 00:13:22,940
unique IDs for each of the object.

222
00:13:22,940 --> 00:13:25,700
But I have upgraded this saw.py file code.

223
00:13:25,700 --> 00:13:31,400
And now in the output you will be getting the uh bounding box coordinates unique IDs.

224
00:13:31,400 --> 00:13:33,530
Plus you will also be getting the class names.

225
00:13:33,530 --> 00:13:38,930
So if you use this uh saw.py code over here, you will not be able to get the class names, but I have

226
00:13:38,930 --> 00:13:39,860
updated this code.

227
00:13:39,860 --> 00:13:45,230
Now you will be getting the, uh, classes name unique IDs, because in object tracking we assign a

228
00:13:45,230 --> 00:13:51,110
unique ID to each of the object, and plus you will be also be getting the bounding box coordinates.

229
00:13:51,230 --> 00:13:51,590
Okay.

230
00:13:51,590 --> 00:13:52,400
So it's your choice.

231
00:13:52,400 --> 00:13:54,680
Either you use this, but I have updated this code a bit.

232
00:13:54,680 --> 00:13:56,240
So I will be using that code.

233
00:13:56,750 --> 00:13:58,910
So let me add the code over here.

234
00:14:07,210 --> 00:14:08,890
So over here.

235
00:14:09,890 --> 00:14:10,340
Okay.

236
00:14:12,020 --> 00:14:12,770
So who are you?

237
00:14:12,770 --> 00:14:13,160
Here?

238
00:14:13,160 --> 00:14:17,750
You can see we have the updated source code and we will be using this.

239
00:14:17,840 --> 00:14:22,460
Um, we will be using this function sort over this class over here.

240
00:14:22,460 --> 00:14:25,820
And we will be using the update function over here.

241
00:14:26,000 --> 00:14:26,390
Okay.

242
00:14:26,390 --> 00:14:30,380
And from here we will be getting the bounding box coordinates, unique IDs for each of the object.

243
00:14:30,380 --> 00:14:34,100
And along with this we will also be getting the class IDs or the class names.

244
00:14:34,490 --> 00:14:37,010
Okay so let's go ahead with this.

245
00:14:37,010 --> 00:14:41,090
I am creating a new file detect-dual-tracking.py file.

246
00:14:41,090 --> 00:14:43,520
And let me add that file over here.

247
00:14:46,660 --> 00:14:50,890
So I have just created a new file detect-dual-tracking.py.

248
00:14:51,100 --> 00:14:56,200
And over here I will be writing the code to do object tracking using sort algorithm.

249
00:14:56,200 --> 00:14:56,770
The object.

250
00:14:56,770 --> 00:15:00,100
The code for object detection using yolo v9 is already added.

251
00:15:00,100 --> 00:15:06,340
I just need to add or integrate the object tracking code into this.py file, and we will be using the

252
00:15:06,370 --> 00:15:08,860
doing the object tracking using sort algorithm.

253
00:15:08,980 --> 00:15:13,510
Uh, in object tracking, what we do in object tracking, we basically assign a unique ID to each of

254
00:15:13,510 --> 00:15:14,260
the objects.

255
00:15:14,260 --> 00:15:17,080
So here you can see we have the sort.py file.

256
00:15:17,080 --> 00:15:21,490
And from the sort.py file I will be importing all the functions.

257
00:15:21,490 --> 00:15:24,070
And to import all the functions we will just write star.

258
00:15:24,070 --> 00:15:27,460
So it will import all the functions from the sort.py file.

259
00:15:29,230 --> 00:15:31,900
Next I will be just writing tracker.

260
00:15:34,470 --> 00:15:38,910
So if you just open this up for.py file over here.

261
00:15:39,330 --> 00:15:44,130
So I will be using this class uh which is this.

262
00:15:44,130 --> 00:15:47,400
So I will be using this class sort over here.

263
00:15:47,400 --> 00:15:49,710
So I will just write sort.

264
00:15:51,340 --> 00:15:53,200
And if I just see.

265
00:15:53,200 --> 00:15:55,210
So here we have the maximum age.

266
00:15:55,210 --> 00:15:57,700
So in maximum age or what we define.

267
00:15:57,700 --> 00:16:03,460
So for example if an object is lost or is there if there is any occlusion if the object is facing.

268
00:16:03,460 --> 00:16:10,690
So if for example, in simple words, if an object is lost, how many frames our sort algorithm will

269
00:16:10,690 --> 00:16:13,510
wait before assigning it a new ID.

270
00:16:13,510 --> 00:16:20,380
So for example, if an object is lost in the frame of a video, how many frames the sort algorithm will

271
00:16:20,380 --> 00:16:23,740
wait before assigning a new unique ID.

272
00:16:23,890 --> 00:16:27,640
So if I just write this value 20 over here.

273
00:16:27,640 --> 00:16:31,480
So our saw if for example, if I just write 20 over here.

274
00:16:31,480 --> 00:16:40,540
So if the car is lost in the video frame, our sort algorithm will wait 20 for 20 frames before assigning

275
00:16:40,540 --> 00:16:41,680
it a new ID.

276
00:16:41,770 --> 00:16:48,040
So maximum age we define if an object is lost in a video frame.

277
00:16:48,040 --> 00:16:54,550
How many, uh, frames our sort algorithm will wait before assigning it a new unique ID.

278
00:16:54,550 --> 00:17:02,440
So if I just write 20 over here so our sort algorithm will wait 20 frames before assigning, uh, the

279
00:17:02,440 --> 00:17:04,690
object object a new UK unique ID.

280
00:17:04,930 --> 00:17:05,560
Okay.

281
00:17:06,040 --> 00:17:06,790
So.

282
00:17:09,520 --> 00:17:16,690
So our sort algorithm will be waiting 2420 frames before assigning, uh, that object a new unique ID

283
00:17:16,690 --> 00:17:19,600
if the that object ID is lost.

284
00:17:20,680 --> 00:17:25,210
Then we will define minimum hits as three and IOU threshold.

285
00:17:25,240 --> 00:17:26,350
I have already defined this.

286
00:17:26,350 --> 00:17:27,910
What is IOU threshold at the start.

287
00:17:27,910 --> 00:17:29,920
So we'll just keep this value 0.3.

288
00:17:32,230 --> 00:17:41,980
Okay, so next what we will do is, uh, I will just go down below and, uh, where I will start writing

289
00:17:41,980 --> 00:17:43,120
the code.

290
00:17:45,230 --> 00:17:46,820
So I will just write the code.

291
00:17:47,210 --> 00:17:50,570
How we can do object tracking using sort algorithm over here.

292
00:17:58,760 --> 00:18:00,290
So let's get started with it.

293
00:18:00,290 --> 00:18:06,200
So first of all I will just create an empty numpy array of size.

294
00:18:07,180 --> 00:18:08,500
Zero six.

295
00:18:11,970 --> 00:18:18,750
Okay, so from here from the Yolo v9 algorithm, we will be getting the bounding box coordinates confidence

296
00:18:18,750 --> 00:18:20,220
score and the class name.

297
00:18:20,220 --> 00:18:23,820
So here from here is the output of the Yolo v9 algorithm.

298
00:18:23,820 --> 00:18:25,620
So if I just show you over here.

299
00:18:25,620 --> 00:18:32,190
So from the Yolo v9 algorithm we get the uh bounding box coordinates class name and confidence score.

300
00:18:32,190 --> 00:18:38,400
So we get the uh top left corner bounding box coordinates which are x one, y one.

301
00:18:38,400 --> 00:18:43,680
And for each of the detected object we get the top left corner bounding box coordinates x one, y one,

302
00:18:43,680 --> 00:18:47,970
and the bottom right corner bounding box coordinates which are x two, y two.

303
00:18:47,970 --> 00:18:51,270
So and plus we also get the class name and confidence score.

304
00:18:51,270 --> 00:18:56,310
So for each of the detected object we will be getting the top left corner bounding box coordinates X1Y1

305
00:18:56,310 --> 00:19:00,300
and bottom right corner uh bounding box coordinates X2Y2.

306
00:19:00,300 --> 00:19:02,160
So for each of the detected object.

307
00:19:08,720 --> 00:19:11,840
So over here I will just write for x, y x, y.

308
00:19:12,940 --> 00:19:16,360
So these are this is the X1Y2X1Y1.

309
00:19:16,360 --> 00:19:18,310
And this is X2Y2.

310
00:19:18,340 --> 00:19:18,880
Okay.

311
00:19:21,070 --> 00:19:23,980
So from your lovin algorithm, we get the.

312
00:19:25,040 --> 00:19:25,580
Boundingbox.

313
00:19:25,580 --> 00:19:27,560
Coordinate confidence score and class name.

314
00:19:28,970 --> 00:19:32,480
And we weren't getting this from infections.

315
00:19:32,810 --> 00:19:33,080
Okay.

316
00:19:35,630 --> 00:19:40,460
So let's separate the x1, y1 x2 y2 values.

317
00:19:45,720 --> 00:19:49,170
So from here the output is basically in the form of tensors.

318
00:19:49,170 --> 00:19:51,750
We need to convert the output from tensors into integers.

319
00:20:10,300 --> 00:20:13,690
So now we are just converting the output from tensors into integers.

320
00:20:15,060 --> 00:20:17,850
Then we just need to calculate the confidence score.

321
00:20:18,180 --> 00:20:21,330
So we just need to have math dot ceil.

322
00:20:21,330 --> 00:20:25,680
And we need to convert the confidence value into integers as well.

323
00:20:28,340 --> 00:20:31,460
You can call this as confidence score over here as well.

324
00:20:37,160 --> 00:20:40,730
Last will also be getting the class name over here.

325
00:20:43,560 --> 00:20:44,010
In.

326
00:20:47,860 --> 00:20:48,910
So.

327
00:20:48,910 --> 00:20:53,050
So these are the, uh, output which gets which we get from the Yolo v9 algorithm.

328
00:20:53,050 --> 00:20:57,610
Yolo v9 algorithm gives us the bounding box coordinates, confidence score and the class name.

329
00:20:57,610 --> 00:21:01,750
And now we'll create an array which we call grant array.

330
00:21:08,840 --> 00:21:10,580
And in this area we will have the.

331
00:21:12,510 --> 00:21:13,470
Bounding box coordinates.

332
00:21:13,470 --> 00:21:14,220
Values.

333
00:21:15,120 --> 00:21:19,860
And we'll also have the confidence score over here.

334
00:21:19,860 --> 00:21:21,420
And the class name.

335
00:21:23,690 --> 00:21:24,350
Over here.

336
00:21:24,680 --> 00:21:30,530
Okay, so let me show you how this looks like if I just print this out over here.

337
00:21:36,140 --> 00:21:37,730
Uh, I think so.

338
00:21:39,480 --> 00:21:42,540
We don't need to view the output image currently.

339
00:21:43,530 --> 00:21:44,520
And.

340
00:21:47,920 --> 00:21:55,600
Right in Thai restaurant on this other video and let me show you how this looks up.

341
00:21:56,050 --> 00:22:00,190
So in any case, if there are any error appears, we'll try to sort this up as well.

342
00:22:08,140 --> 00:22:14,170
Okay, so to run the sort algorithm skills step, we need to have the filter pi package installed as

343
00:22:14,170 --> 00:22:14,650
well.

344
00:22:14,650 --> 00:22:21,220
So I will just uh pi pip install filter pi.

345
00:22:22,150 --> 00:22:26,080
So I will just right add this up in this as well.

346
00:22:26,800 --> 00:22:27,370
Filter pi.

347
00:22:27,370 --> 00:22:30,820
So we just need to install this package individually as well.

348
00:22:31,150 --> 00:22:33,010
So let's run this up now.

349
00:22:33,010 --> 00:22:34,960
Hopefully it will run now.

350
00:22:46,370 --> 00:22:47,570
Though it has started.

351
00:22:53,250 --> 00:22:53,790
We will not.

352
00:22:53,790 --> 00:22:56,250
So now you can see over here okay.

353
00:22:56,250 --> 00:22:57,390
So okay.

354
00:22:58,340 --> 00:23:02,930
So here you can see that, uh, so for example.

355
00:23:04,880 --> 00:23:09,530
In the first frame we have 28 persons detected and there is one handbag.

356
00:23:09,980 --> 00:23:15,350
So in the first frame we have detected 28 persons and there is one handbag.

357
00:23:15,380 --> 00:23:16,100
Okay.

358
00:23:16,100 --> 00:23:20,120
So now you can see this is 26 ID which is for handbag.

359
00:23:20,570 --> 00:23:25,340
So these are the x1 y1 x2, y2 bounding box coordinates.

360
00:23:25,340 --> 00:23:26,480
This is the confidence score.

361
00:23:26,480 --> 00:23:27,920
And this is the class name.

362
00:23:28,010 --> 00:23:28,370
Okay.

363
00:23:28,370 --> 00:23:34,850
So in the same way we have already written over here like we have the bounding box coordinates and confidence

364
00:23:34,850 --> 00:23:35,960
score and class name.

365
00:23:35,960 --> 00:23:40,670
So like you can see we have detected 28 persons and one handbag.

366
00:23:40,700 --> 00:23:44,750
So for all the 28 persons we have this coordinate.

367
00:23:44,750 --> 00:23:50,240
So for each of the detected object like for the first detected object we have this bounding box coordinates.

368
00:23:50,240 --> 00:23:51,890
And we have this confidence score.

369
00:23:51,890 --> 00:23:57,530
And this is the class name for the second object uh detected object we have this bounding box coordinates.

370
00:23:57,620 --> 00:23:59,510
And this is the confidence score.

371
00:23:59,510 --> 00:24:02,360
And this is the class name for the third detected object.

372
00:24:02,360 --> 00:24:03,830
These are the bounding box coordinates.

373
00:24:03,830 --> 00:24:05,270
This is the confidence score.

374
00:24:05,270 --> 00:24:06,350
And this is the class name.

375
00:24:06,350 --> 00:24:10,970
So we are just getting the bounding box coordinates confidence score and class name for each of the

376
00:24:10,970 --> 00:24:12,830
object one by one over here.

377
00:24:15,030 --> 00:24:18,270
So let's go ahead with this up as well now.

378
00:24:21,060 --> 00:24:23,940
So now I will just write detection is equal to NP dot p stack.

379
00:24:23,940 --> 00:24:26,010
So we will be doing vertical stack.

380
00:24:33,070 --> 00:24:34,150
Deductions.

381
00:24:37,140 --> 00:24:37,680
Country.

382
00:24:38,220 --> 00:24:41,040
So now let me show you what this vertical stack does.

383
00:24:41,040 --> 00:24:42,660
So if I just write.

384
00:24:43,880 --> 00:24:44,330
Then.

385
00:24:47,200 --> 00:24:48,370
Actions.

386
00:24:50,380 --> 00:24:50,770
Okay.

387
00:24:52,020 --> 00:24:54,630
So let's run this script again.

388
00:25:17,560 --> 00:25:18,220
So let me show you.

389
00:25:18,220 --> 00:25:19,780
We have the for the first frame.

390
00:25:20,850 --> 00:25:21,840
Okay.

391
00:25:24,120 --> 00:25:26,610
So let me just roll it up now.

392
00:25:30,440 --> 00:25:34,940
So now you can see that these are the bounding box coordinates for the first detection.

393
00:25:35,330 --> 00:25:35,600
Okay.

394
00:25:35,600 --> 00:25:36,740
This is the confidence score.

395
00:25:36,740 --> 00:25:38,360
And this is the class name.

396
00:25:38,510 --> 00:25:39,050
Okay.

397
00:25:39,050 --> 00:25:43,610
So now like you can see that this is the first uh array.

398
00:25:43,850 --> 00:25:44,360
Okay.

399
00:25:44,360 --> 00:25:50,750
And then for the so now you can see that these are the bounding box coordinates for the second detection.

400
00:25:50,750 --> 00:25:52,670
And this is the confidence score.

401
00:25:52,670 --> 00:25:53,960
And this is the class name.

402
00:25:53,960 --> 00:26:00,170
But you can see over here we have also added the first detected object bounding box coordinates.

403
00:26:01,210 --> 00:26:05,440
Contnued confidence score and class name into this numpy array as well.

404
00:26:05,470 --> 00:26:07,540
Now if I just code over here.

405
00:26:07,540 --> 00:26:12,730
Now these are the bounding box coordinates confidence score and class name for the first two detections.

406
00:26:12,730 --> 00:26:14,770
Now here you can see we have for the third detection.

407
00:26:14,770 --> 00:26:19,390
And I have added the bounding box coordinates confidence score and class name for the first two detections

408
00:26:19,390 --> 00:26:19,930
as well.

409
00:26:19,930 --> 00:26:22,330
So we are doing vertical stack over here.

410
00:26:22,570 --> 00:26:27,670
And here you can see these are the bounding box coordinates confidence score and the class name for

411
00:26:27,670 --> 00:26:28,780
the for detection.

412
00:26:28,780 --> 00:26:33,820
But I have added the bounding box coordinate confidence score and class name for the first three detections

413
00:26:33,820 --> 00:26:35,500
as well okay.

414
00:26:37,110 --> 00:26:39,270
So this is how it works.

415
00:26:49,020 --> 00:26:50,730
Now I will just write.

416
00:26:53,880 --> 00:26:54,390
Tracker.

417
00:26:54,390 --> 00:27:00,360
So you can see that I've initialized the sort, uh, algorithm over above over here.

418
00:27:00,360 --> 00:27:01,830
So we initialized over here.

419
00:27:01,830 --> 00:27:03,000
So we have tracker.

420
00:27:04,320 --> 00:27:08,520
Okay, so now I will just write over here tracker.

421
00:27:08,520 --> 00:27:12,120
So I will be using the update function inside this sort.

422
00:27:12,150 --> 00:27:13,110
Dot py file.

423
00:27:13,110 --> 00:27:18,450
So I'm using the class sort and I will be using this update function over here which you can see.

424
00:27:18,600 --> 00:27:19,500
So.

425
00:27:21,610 --> 00:27:25,690
Okay, so let's use the tracker dot update.

426
00:27:28,140 --> 00:27:30,240
And what this function accepts.

427
00:27:30,240 --> 00:27:32,070
So this function accepts reductions.

428
00:27:32,070 --> 00:27:36,060
And over here I will passing this reductions over here.

429
00:27:38,010 --> 00:27:38,550
Okay.

430
00:27:38,550 --> 00:27:43,860
So so now before we go ahead, uh, the, the sort algorithm.

431
00:27:43,860 --> 00:27:49,410
So the input of the Sort algorithm, we have passed out the bounding box coordinates confidence score

432
00:27:49,410 --> 00:27:50,220
and class name.

433
00:27:50,220 --> 00:27:54,030
So what output we get from the sort algorithm okay.

434
00:27:54,690 --> 00:27:56,730
So if I just open this from here.

435
00:27:56,730 --> 00:28:02,250
So from the sort object tracking algorithm we get out we get the bounding box coordinates identities,

436
00:28:02,250 --> 00:28:04,680
unique IDs for each of the object and class name.

437
00:28:04,680 --> 00:28:09,060
So we don't get the confidence score from the sort object tracking algorithm output.

438
00:28:09,060 --> 00:28:11,910
We get the unique IDs for each of the detected object.

439
00:28:12,730 --> 00:28:13,030
Okay.

440
00:28:16,690 --> 00:28:17,920
So I will just write.

441
00:28:19,370 --> 00:28:22,010
So if there are any detections.

442
00:28:26,940 --> 00:28:29,400
So this will return us the bounding box coordinates.

443
00:28:35,140 --> 00:28:38,350
So if you just print this tracker detections.

444
00:28:38,350 --> 00:28:41,920
Uh, let me just print this out first and then we will discuss.

445
00:28:48,280 --> 00:28:49,030
Okay?

446
00:28:49,540 --> 00:28:50,050
Yeah, sure.

447
00:28:51,220 --> 00:28:51,580
Soon.

448
00:28:56,740 --> 00:28:58,570
Well, let's run this up first.

449
00:29:09,440 --> 00:29:12,440
So this will take a few seconds before it starts executing.

450
00:29:22,040 --> 00:29:23,600
Okay, so here we have it.

451
00:29:24,460 --> 00:29:30,490
So if you just see over here so the first four have the bounding box coordinates.

452
00:29:30,820 --> 00:29:31,090
Okay.

453
00:29:31,090 --> 00:29:33,070
So if I just write over here.

454
00:29:35,590 --> 00:29:36,040
So.

455
00:29:41,250 --> 00:29:43,800
In the first four, we have the bounding box coordinates.

456
00:29:50,910 --> 00:29:57,270
And these are 0012345678.

457
00:29:57,270 --> 00:30:00,870
The eight item contain the unique IDs.

458
00:30:04,740 --> 00:30:05,400
Okay.

459
00:30:05,970 --> 00:30:07,200
And.

460
00:30:09,130 --> 00:30:14,440
01234, and this fourth item contains the class names.

461
00:30:14,440 --> 00:30:15,040
Okay.

462
00:30:17,300 --> 00:30:19,550
Or these are the class IDs you can say.

463
00:30:21,230 --> 00:30:24,860
So we can simply write get grease.

464
00:30:31,030 --> 00:30:35,890
So this four item, uh, 01234 contain the class IDs.

465
00:30:38,290 --> 00:30:44,020
So now I have just created a function over here by the name draw those boxes inside the draw boxes.

466
00:30:44,020 --> 00:30:44,740
Function.

467
00:30:44,920 --> 00:30:45,340
Function.

468
00:30:45,340 --> 00:30:46,390
Draw boxes function.

469
00:30:46,390 --> 00:30:50,320
We pass down the bounding box coordinates and entities and the class ids.

470
00:30:50,320 --> 00:30:53,890
For example, the class ID for the person class is zero.

471
00:30:53,890 --> 00:30:55,330
For the bicycle it's one.

472
00:30:55,720 --> 00:30:56,260
Okay.

473
00:30:56,260 --> 00:30:58,210
And this, uh, what?

474
00:30:58,210 --> 00:31:01,840
In the draw box function I've just written using OpenCV.

475
00:31:02,020 --> 00:31:06,100
Uh cv2 dot rectangle function OpenCV cv2 dot rectangle function.

476
00:31:06,100 --> 00:31:10,000
We are drawing the bounding box coordinates or rectangles around each of the detected object.

477
00:31:10,000 --> 00:31:15,340
Plus we are also creating a rectangle above the detected object, where we will be adding the IDs and

478
00:31:15,340 --> 00:31:17,950
the class names over there as well.

479
00:31:17,950 --> 00:31:24,370
So in the label we will have the id and the class name, and we will be drawing a circle at the center

480
00:31:24,370 --> 00:31:26,290
of each of the detected object as well.

481
00:31:26,290 --> 00:31:28,960
And let me discuss this in detail okay.

482
00:31:28,960 --> 00:31:32,980
So I will just calling the draw boxes function over here.

483
00:31:34,110 --> 00:31:36,270
Well, this is the input video frame.

484
00:31:38,280 --> 00:31:38,790
Morning.

485
00:31:38,790 --> 00:31:39,780
Most gardeners.

486
00:31:41,010 --> 00:31:44,190
Unique IDs for each of the detected object and the categories.

487
00:31:44,250 --> 00:31:45,900
Okay, so.

488
00:31:47,170 --> 00:31:50,350
So now you can see I have this path to the draw boxes function.

489
00:31:50,350 --> 00:31:52,300
And here we have this function.

490
00:31:52,300 --> 00:31:55,870
So here we are just finding the center point of the bounding box.

491
00:31:55,870 --> 00:32:03,430
We are just uh have finding the unique I and uh, giving the unique IDs to each of the object which

492
00:32:03,430 --> 00:32:07,600
we have or which we are already getting the sort algorithm, we are drawing drawing rectangle around

493
00:32:07,600 --> 00:32:08,620
each of the detected object.

494
00:32:08,620 --> 00:32:11,080
Plus we have just created this function class names.

495
00:32:11,080 --> 00:32:16,120
So if we get the object id zero this mean it represent the detected object is the person.

496
00:32:16,120 --> 00:32:22,630
If the get uh class ID or categories, which we have called this as one, it is a bicycle restricted.

497
00:32:22,630 --> 00:32:24,820
If the class ID which we got is two.

498
00:32:24,850 --> 00:32:26,170
So the car is detected.

499
00:32:26,170 --> 00:32:28,750
If the class ID is three then the motorbike is detected.

500
00:32:28,750 --> 00:32:31,480
If the car class ID is four then the aeroplane is detected.

501
00:32:31,480 --> 00:32:33,820
If the class ID is five, then the bus is detected.

502
00:32:33,820 --> 00:32:36,820
If the class ID is 80, then the toothbrush is detected.

503
00:32:36,820 --> 00:32:40,960
If the class ID is, uh 79, then here I draw restricted.

504
00:32:40,960 --> 00:32:41,470
Okay.

505
00:32:41,470 --> 00:32:42,280
So.

506
00:32:43,520 --> 00:32:45,110
You can see over here.

507
00:32:45,440 --> 00:32:48,770
Um, so here we have the class IDs.

508
00:32:48,770 --> 00:32:51,410
So, so in the categories we have the class IDs.

509
00:32:51,410 --> 00:32:55,610
And this ID represent a unique ID which we assign to each of the object.

510
00:32:55,640 --> 00:32:56,030
Okay.

511
00:32:56,030 --> 00:32:59,570
So in object tracking we basically assign a unique ID to each of the object.

512
00:32:59,570 --> 00:33:04,040
So you can see that in this cat we cat cat we have the class ID.

513
00:33:04,040 --> 00:33:07,460
And when this we pass the class ID over here.

514
00:33:07,460 --> 00:33:11,030
So if the class ID is zero then we will be calling this function over here.

515
00:33:11,030 --> 00:33:14,030
And it will tell us that this is a person class and so on.

516
00:33:14,090 --> 00:33:14,720
Okay.

517
00:33:14,720 --> 00:33:19,760
And in the label we have the unique ID that we have assigned to each of the object plus the class name

518
00:33:19,760 --> 00:33:20,510
over here.

519
00:33:22,200 --> 00:33:26,970
And then we are just drawing a circle around each of us at the center of each of the detected object.

520
00:33:27,480 --> 00:33:31,800
Okay, so now I will just run this script over here.

521
00:33:32,980 --> 00:33:39,190
So plus I will just write view dash image and let's run this up over here.

522
00:33:40,950 --> 00:33:46,530
Let's see if we are able to detect the objects and assign a unique ID to each of the detected object

523
00:33:46,530 --> 00:33:48,540
using the Sort algorithm or not.

524
00:33:57,320 --> 00:33:58,580
So over here.

525
00:33:58,580 --> 00:33:59,240
That's great.

526
00:33:59,240 --> 00:34:06,290
So now you can see over here, uh, each detected object is being assigned a unique ID six 232 2314

527
00:34:06,290 --> 00:34:15,620
1710 2925 2119 eight 1813 1516, 1231 2020.

528
00:34:15,620 --> 00:34:20,180
So you can see that using object tracking algorithm, we are able to assign a unique ID to each of the

529
00:34:20,180 --> 00:34:20,960
detected object.

530
00:34:20,960 --> 00:34:22,340
And that's amazing.

531
00:34:22,340 --> 00:34:23,210
That's great.

532
00:34:23,510 --> 00:34:26,300
Okay so I'm testing on CPU.

533
00:34:26,300 --> 00:34:27,920
So the processing is a bit slow.

534
00:34:27,920 --> 00:34:31,340
Let me just test it on other video as well.

535
00:34:56,130 --> 00:35:01,020
So now you can see over here we have assigned a unique ID to the car as well.

536
00:35:01,020 --> 00:35:04,800
So this is the wrong detection but a unique ID assigned to each of the object.

537
00:35:04,800 --> 00:35:09,930
Because we assign a unique ID to each of the detections using sort algorithm.

538
00:35:10,230 --> 00:35:10,620
Okay.

539
00:35:10,620 --> 00:35:12,900
So one for two.

540
00:35:13,050 --> 00:35:15,900
So that will look pretty fine as well.

541
00:35:16,080 --> 00:35:19,500
Like you can see let's see if we are able to detect this car or not.

542
00:35:19,500 --> 00:35:24,030
So you can see the car is detected and unique ID seven is assigned over here as well.

543
00:35:24,030 --> 00:35:25,770
And this works pretty good.

544
00:35:26,800 --> 00:35:32,350
So if you want to test it on the live webcam feed, you can, uh, simply right over here in the source

545
00:35:32,350 --> 00:35:32,800
zero.

546
00:35:32,800 --> 00:35:36,550
So if you write source zero, you will be able to test on the live webcam feed.

547
00:35:36,550 --> 00:35:39,670
And if you want to test on the external webcam, you can write one.

548
00:35:39,670 --> 00:35:43,720
And if you want to test, uh, test on the uh, like IP camera.

549
00:35:43,720 --> 00:35:47,050
So you can just pass the IP, um, link over here.

550
00:35:47,050 --> 00:35:50,620
So if you want to test on the, uh, your laptop webcam, you can just write zero.

551
00:35:50,620 --> 00:35:53,950
If you want to test on external webcam, you can write one over here.

552
00:35:53,950 --> 00:36:00,670
So if you want to test, uh, if you want to detect only specific classes, like if you just write over

553
00:36:00,670 --> 00:36:03,280
here like test dot mp4.

554
00:36:03,280 --> 00:36:08,770
So if you want to like you want to only detect uh person class okay.

555
00:36:08,770 --> 00:36:12,130
So the person class ID is.

556
00:36:14,510 --> 00:36:15,260
Zero.

557
00:36:15,470 --> 00:36:21,380
Okay, so you can see over here, uh, if I just show you the person class ID zero.

558
00:36:21,380 --> 00:36:22,430
So I will just write.

559
00:36:22,430 --> 00:36:23,210
Class is zero.

560
00:36:23,210 --> 00:36:27,140
So this will only detect the person class and no other object will be detected.

561
00:36:27,140 --> 00:36:28,850
So you can do this as well.

562
00:36:35,470 --> 00:36:38,980
Oh, this will take few seconds before this script gets executed.

563
00:36:46,650 --> 00:36:49,380
Uh, one thing we can do is.

564
00:36:51,410 --> 00:36:53,150
You can simply remove the sperm.

565
00:36:55,890 --> 00:36:58,620
So let's see how our output looks like.

566
00:37:00,550 --> 00:37:04,660
Okay, so now you can see over here, uh, we are only detecting the person class.

567
00:37:04,660 --> 00:37:05,830
No hand-bags.

568
00:37:05,830 --> 00:37:08,560
No other thing is, uh, detected over here.

569
00:37:08,560 --> 00:37:13,420
Okay, so now you can see that we are only detecting the person class.

570
00:37:13,420 --> 00:37:16,480
No hand-bags or no other things are being detected.

571
00:37:16,480 --> 00:37:22,420
So you can select any specific class which you want to detect in a video frame feed as well, or in

572
00:37:22,420 --> 00:37:23,620
the live webcam feed.

573
00:37:23,620 --> 00:37:25,570
So that's all from this tutorial.

574
00:37:25,570 --> 00:37:26,440
Thank you for watching!

575
00:37:26,440 --> 00:37:31,060
In this tutorial, we have learned how we can integrate object detection with object tracking.

576
00:37:31,060 --> 00:37:34,840
And here we are using, uh, sort algorithm to do object tracking.

577
00:37:34,840 --> 00:37:37,840
And for the object detection we are using the Yolo v nine algorithm.

578
00:37:37,840 --> 00:37:38,590
Thank you for watching.

579
00:37:38,590 --> 00:37:38,950
Bye bye.
