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 plot the detected objects after doing detections using

3
00:00:09,000 --> 00:00:14,000
YOLO and tracking using your deep sort of algorithm.

4
00:00:14,000 --> 00:00:21,000
So after doing detections using YOLO V8, we will blurred the detected objects and for object tracking

5
00:00:21,000 --> 00:00:23,000
we will use the deepsort algorithm.

6
00:00:23,000 --> 00:00:29,000
So for this project I will be using this GitHub repo over here so you can see this YOLO v8 Deepsort

7
00:00:29,000 --> 00:00:31,000
object tracking repo.

8
00:00:31,000 --> 00:00:40,000
So in this code we have already in this GitHub repo, the YOLO V8 object tracking code is already in

9
00:00:40,000 --> 00:00:44,000
Deepsort Object tracking code is already integrated with the YOLO V8 algorithm.

10
00:00:44,000 --> 00:00:50,000
So currently we have the object tracking code integrated with the YOLO V8 algorithm.

11
00:00:50,000 --> 00:00:54,000
We only need to add the object blurring code into it.

12
00:00:54,000 --> 00:00:54,000
Okay.

13
00:00:54,000 --> 00:00:59,000
So we will clone this github repo into our Google colab notebook over here.

14
00:01:00,000 --> 00:01:00,000
Okay.

15
00:01:00,000 --> 00:01:06,000
So I have created a GitHub code Google CoLab notebook for this project which you can see in front of

16
00:01:06,000 --> 00:01:07,000
your screen.

17
00:01:07,000 --> 00:01:14,000
So, so currently we have object tracking integrated with the YOLO V8 algorithm.

18
00:01:14,000 --> 00:01:17,000
We only need to add the object blurring code.

19
00:01:17,000 --> 00:01:23,000
So when we have the bounding box around the detected objects, we will blurred the object inside the

20
00:01:23,000 --> 00:01:24,000
bounding box.

21
00:01:24,000 --> 00:01:25,000
So this is our target.

22
00:01:25,000 --> 00:01:30,000
So first of all, I will clone this GitHub repo into our Google CoLab notebook.

23
00:01:31,000 --> 00:01:36,000
Before running the script, please make sure that you have selected the runtime as GPU.

24
00:01:36,000 --> 00:01:39,000
So now this GitHub repo is cloned into our Google CoLab notebook.

25
00:01:39,000 --> 00:01:41,000
And you can see this over here.

26
00:01:42,000 --> 00:01:47,000
Now we'll set this GitHub repo on GitHub repo as our current directory over here.

27
00:01:48,000 --> 00:01:48,000
Okay.

28
00:01:48,000 --> 00:01:49,000
So just ctrl v.

29
00:01:51,000 --> 00:01:51,000
So now.

30
00:01:52,000 --> 00:01:57,000
Now we need to install all the required libraries or the dependencies that are necessary to run this

31
00:01:57,000 --> 00:01:58,000
script successfully.

32
00:01:58,000 --> 00:02:04,000
So for this I will just run this cell so it will install all the required libraries that are required

33
00:02:04,000 --> 00:02:05,000
to run this script.

34
00:02:05,000 --> 00:02:11,000
So if you skip this step, then while doing the training validation or the prediction, you might face

35
00:02:11,000 --> 00:02:14,000
this error that the Hydra library is not installed.

36
00:02:14,000 --> 00:02:16,000
Matplotlib library is not installed.

37
00:02:16,000 --> 00:02:20,000
Seaborn Library is not installed, so it's necessary to run this step.

38
00:02:20,000 --> 00:02:24,000
So when you run this cell, you will see that requirements already satisfied, which means that some

39
00:02:24,000 --> 00:02:27,000
libraries are by default installed in the Google CoLab notebook.

40
00:02:27,000 --> 00:02:32,000
While some libraries are not by default installed the Google CoLab notebook.

41
00:02:32,000 --> 00:02:32,000
So it will be.

42
00:02:32,000 --> 00:02:40,000
So those library will be downloaded into the Google CoLab notebook like what you can say installed into

43
00:02:40,000 --> 00:02:41,000
the Google CoLab notebook.

44
00:02:41,000 --> 00:02:45,000
When you run this cell, like you can see that many of the libraries are not pre-installed.

45
00:02:45,000 --> 00:02:53,000
And when you run this cell, many of the libraries get installed, which include requests markdown Watchdog

46
00:02:53,000 --> 00:02:55,000
CD and all these libraries.

47
00:02:55,000 --> 00:02:58,000
So these libraries are not installed.

48
00:02:58,000 --> 00:03:03,000
So when we run this step, these libraries get installed while some libraries are by default installed

49
00:03:03,000 --> 00:03:05,000
in the Google CoLab notebook.

50
00:03:06,000 --> 00:03:08,000
So, uh, as we are doing.

51
00:03:10,000 --> 00:03:11,000
As we are doing the detection.

52
00:03:11,000 --> 00:03:14,000
So I will just navigate to the detection folder over here.

53
00:03:14,000 --> 00:03:16,000
So just give me a minute.

54
00:03:16,000 --> 00:03:17,000
Let's just refreshing.

55
00:03:17,000 --> 00:03:18,000
Okay.

56
00:03:18,000 --> 00:03:22,000
So if we see over here, just give me a minute, please.

57
00:03:22,000 --> 00:03:22,000
Okay.

58
00:03:22,000 --> 00:03:30,000
So as we see over here, if we go to Ultralytics, then we go to YOLO and we go to V8, then we go to

59
00:03:30,000 --> 00:03:31,000
detect.

60
00:03:31,000 --> 00:03:36,000
So we need to set this as our current directory because we are performing object detection and tracking.

61
00:03:36,000 --> 00:03:38,000
We are not doing segmentation.

62
00:03:38,000 --> 00:03:39,000
Okay.

63
00:03:39,000 --> 00:03:43,000
So just set this as your current directory and just run this cell.

64
00:03:45,000 --> 00:03:45,000
Okay.

65
00:03:45,000 --> 00:03:51,000
So as we are implementing object tracking using Deepsort, what we do in object tracking is we assign

66
00:03:51,000 --> 00:03:53,000
a unique ID to each of the detected object.

67
00:03:53,000 --> 00:03:58,000
This is the only function of object tracking to assign a unique ID to each of the detected objects.

68
00:03:58,000 --> 00:04:03,000
So to implement object tracking, I am using the deepsort algorithm, so we need to have the Deepsort

69
00:04:03,000 --> 00:04:07,000
files into our YOLO repository.

70
00:04:07,000 --> 00:04:11,000
So I'm just downloading the Deepsort files into my repository over here.

71
00:04:11,000 --> 00:04:17,000
So if you see over here you can see that deepsort zip file over here.

72
00:04:18,000 --> 00:04:19,000
Okay, you can.

73
00:04:19,000 --> 00:04:21,000
So we need to unzip this file first.

74
00:04:21,000 --> 00:04:27,000
So I'm just unzipping the deepsort file over here and you can see the unzipped file over here.

75
00:04:27,000 --> 00:04:32,000
I've already explained the YOLO V8 with deepsort object tracking code, so I will not discuss the YOLO

76
00:04:32,000 --> 00:04:36,000
V8 with deepsort object tracking code will only add the object planning code.

77
00:04:36,000 --> 00:04:38,000
If you want to learn this.

78
00:04:38,000 --> 00:04:40,000
I have made multiple video tutorials above.

79
00:04:40,000 --> 00:04:43,000
In the second section you must watch this videos.

80
00:04:44,000 --> 00:04:48,000
Okay, then I will download a sample video for testing from Google Drive.

81
00:04:48,000 --> 00:04:49,000
Okay.

82
00:04:50,000 --> 00:04:57,000
So first of all I will go to the predict.py file and I will add the object bearing code over here.

83
00:04:57,000 --> 00:04:59,000
So this will be a few lines of code.

84
00:04:59,000 --> 00:05:01,000
It will not be more than a few lines.

85
00:05:01,000 --> 00:05:06,000
So first of all, I will just right over here go to below.

86
00:05:06,000 --> 00:05:09,000
So I'm just scrolling down below and.

87
00:05:12,000 --> 00:05:15,000
Now, you can see here I've added the object blurring code.

88
00:05:15,000 --> 00:05:17,000
So let me explain you the code.

89
00:05:18,000 --> 00:05:25,000
In this step, we are just selecting the area where we have the area of the frame where we have the

90
00:05:25,000 --> 00:05:26,000
bounding boxes.

91
00:05:26,000 --> 00:05:30,000
Okay, so here I'm just passing the coordinates of the bounding boxes over here.

92
00:05:30,000 --> 00:05:35,000
I'm just passing the individual coordinates of the bounding boxes in the frame over here.

93
00:05:35,000 --> 00:05:40,000
So I will just crop the area first where we have the bounding boxes.

94
00:05:40,000 --> 00:05:41,000
Okay.

95
00:05:41,000 --> 00:05:43,000
Then I will plot the area.

96
00:05:43,000 --> 00:05:46,000
So then I will blurred those bounding boxes using cv2 dot blur.

97
00:05:46,000 --> 00:05:49,000
And here I've just set up blur ratio over here.

98
00:05:49,000 --> 00:05:50,000
Okay.

99
00:05:50,000 --> 00:05:58,000
Then I will just in the complete frame of the video, I will just add the blurring, add the blur code

100
00:05:58,000 --> 00:06:01,000
on the area where we have the bounding boxes.

101
00:06:01,000 --> 00:06:04,000
So I'm just blurring the detected object.

102
00:06:04,000 --> 00:06:06,000
So I have the bounding boxes around the detected object.

103
00:06:06,000 --> 00:06:09,000
So I'm just blurring the bounding boxes.

104
00:06:09,000 --> 00:06:09,000
Okay.

105
00:06:10,000 --> 00:06:17,000
Of the detected objects over here and then I'm just integrating this code into my original of frame

106
00:06:17,000 --> 00:06:18,000
of the video.

107
00:06:18,000 --> 00:06:21,000
So that is the three lines of code which I have added.

108
00:06:21,000 --> 00:06:25,000
So let's just run this cell and see what results do we get.

109
00:06:25,000 --> 00:06:30,000
So just again, checking the code, if there is any thing we can fix it truly.

110
00:06:30,000 --> 00:06:32,000
Okay, so that's fine.

111
00:06:32,000 --> 00:06:34,000
I think I have missed one thing.

112
00:06:34,000 --> 00:06:36,000
I think I need to define the import.

113
00:06:36,000 --> 00:06:37,000
Cv2 is done.

114
00:06:38,000 --> 00:06:39,000
Everything is done.

115
00:06:41,000 --> 00:06:45,000
Let's run this script and see what results do we get.

116
00:06:45,000 --> 00:06:50,000
If there is any error, we can fix it, but am hopeful that it will work fine.

117
00:06:50,000 --> 00:06:57,000
So it might take some time for to execute and it will process each of the frames separately.

118
00:06:57,000 --> 00:06:58,000
Okay.

119
00:06:58,000 --> 00:07:02,000
So the processing on the video has started over here.

120
00:07:02,000 --> 00:07:03,000
We can see it.

121
00:07:03,000 --> 00:07:07,000
And okay, so the processing on the video has started.

122
00:07:07,000 --> 00:07:09,000
So this will take some time.

123
00:07:09,000 --> 00:07:16,000
So either it has divided the complete video into 942 frames and it is doing the processing on each of

124
00:07:16,000 --> 00:07:18,000
the frames individually.

125
00:07:18,000 --> 00:07:23,000
Currently 147 frames are processed and currently 172 now.

126
00:07:23,000 --> 00:07:28,000
So it is doing the processing on each of the frame one by one.

127
00:07:28,000 --> 00:07:28,000
So.

128
00:07:29,000 --> 00:07:34,000
It will take some time and then we get the output video over here.

129
00:07:34,000 --> 00:07:38,000
So as this per execution complete, I will show you the output demo video.

130
00:07:39,000 --> 00:07:39,000
Okay.

131
00:07:39,000 --> 00:07:41,000
So this might take some time.

132
00:07:51,000 --> 00:07:51,000
Guys.

133
00:07:51,000 --> 00:07:56,000
The processing on the video is done and here we have the output video.

134
00:07:56,000 --> 00:08:01,000
Let me just download this video and show you what results do we get.

135
00:08:01,000 --> 00:08:07,000
Okay, So let me just play this output video and see whether we are able to do the object blurring or

136
00:08:07,000 --> 00:08:11,000
not, or whether we are able to do that, the detected objects or not.

137
00:08:11,000 --> 00:08:15,000
So you can see that we are able to blurred all the detected objects.

138
00:08:15,000 --> 00:08:20,000
You can see that where we have the bounding boxes on the those objects are being blurred.

139
00:08:20,000 --> 00:08:23,000
So let me go over here so you can see that.

140
00:08:24,000 --> 00:08:26,000
We are able to blur the detected objects.

141
00:08:26,000 --> 00:08:29,000
Plus we have also implemented object tracking.

142
00:08:29,000 --> 00:08:38,000
Like you can see that each object is being assigned a unique ID 10413211910916.

143
00:08:38,000 --> 00:08:41,000
Plus we have the tracking trails as well.

144
00:08:41,000 --> 00:08:48,000
So in this project we have implemented an integrated object blurring code with Deepsort object tracking,

145
00:08:48,000 --> 00:08:50,000
YOLO, V8 and YOLO V8.

146
00:08:50,000 --> 00:08:53,000
So that's all from this video tutorial.

147
00:08:53,000 --> 00:08:55,000
I hope you have learned something from this video tutorial.

148
00:08:55,000 --> 00:08:57,000
See you all in the next video.

149
00:08:57,000 --> 00:08:58,000
Till then, bye bye.

