1
00:00:02,000 --> 00:00:03,000
Hello everyone.

2
00:00:03,000 --> 00:00:11,000
In this video tutorial we will see how we can implement the sword object tracking with YOLO V8 in Google

3
00:00:11,000 --> 00:00:11,000
CoLab.

4
00:00:11,000 --> 00:00:18,000
In the last video tutorial I have already explained you that object tracking Deepsort algorithm and

5
00:00:18,000 --> 00:00:21,000
the prediction script in detail.

6
00:00:21,000 --> 00:00:24,000
So I will be just running the Google CoLab script.

7
00:00:24,000 --> 00:00:29,000
I have already explained you the tracking prediction script in the previous lecture, so if you want

8
00:00:29,000 --> 00:00:35,000
to go into the detail of the tracking script and learn about the Deepsort algorithm, please watch the

9
00:00:35,000 --> 00:00:36,000
previous video tutorial.

10
00:00:36,000 --> 00:00:43,000
So here I have opened the YOLO V8 Deepsort object tracking GitHub repo, so I will just go over here

11
00:00:43,000 --> 00:00:47,000
and click on Google CoLab file and click on Open in New Tab.

12
00:00:48,000 --> 00:00:52,000
So here the whole file will be open.

13
00:00:52,000 --> 00:00:54,000
So you can see that changes will not be saved.

14
00:00:54,000 --> 00:00:56,000
So you can copy it to the drive.

15
00:00:57,000 --> 00:00:58,000
We'll just click over here.

16
00:00:58,000 --> 00:01:03,000
So another tab will open a Google CoLab script.

17
00:01:03,000 --> 00:01:06,000
So now if you make any changes in the script, it will be saved.

18
00:01:06,000 --> 00:01:08,000
So just remove this.

19
00:01:08,000 --> 00:01:11,000
So now if you make any changes in the script, it will be saved.

20
00:01:11,000 --> 00:01:16,000
So first, please make sure that you have selected the runtime as GPU.

21
00:01:16,000 --> 00:01:22,000
So if you have not selected the runtime as GPU, if you have selected that runtime as none or CPU.

22
00:01:22,000 --> 00:01:28,000
So it will the script will definitely run, but the predictions on the demo video rendering the prediction

23
00:01:28,000 --> 00:01:34,000
script on a demo video, the predictions per frame will be very low because it will take more time to

24
00:01:34,000 --> 00:01:35,000
do the prediction.

25
00:01:35,000 --> 00:01:39,000
So please make sure that you have selected the runtime as GPU.

26
00:01:40,000 --> 00:01:43,000
So now we will clone the GitHub repo first.

27
00:01:43,000 --> 00:01:45,000
So just run this cell.

28
00:01:47,000 --> 00:01:48,000
It might take two seconds.

29
00:01:49,000 --> 00:01:55,000
Okay, so just running this cell, it might take a few seconds, so please bear with me.

30
00:01:57,000 --> 00:02:01,000
Thought you can see that cloning, that deep sword object tracking.

31
00:02:01,000 --> 00:02:08,000
So if we see over here, we can all see this deep sword object tracking repo cloned over here.

32
00:02:08,000 --> 00:02:12,000
So now we need to set this repo as our current directory.

33
00:02:12,000 --> 00:02:18,000
So you can just click over here, copy path and just paste it over here and just run this cell.

34
00:02:20,000 --> 00:02:24,000
Now we need to install all the dependencies or the requirements.

35
00:02:24,000 --> 00:02:29,000
Basically, it's necessity to install all the dependencies because it installs all the required libraries.

36
00:02:29,000 --> 00:02:31,000
Two required to run the script.

37
00:02:31,000 --> 00:02:37,000
If you now don't install the dependencies, you will face error when you try to run the training or

38
00:02:37,000 --> 00:02:38,000
the prediction script.

39
00:02:38,000 --> 00:02:39,000
So you can see that.

40
00:02:41,000 --> 00:02:48,000
If we run the dependency script, it will install all the required libraries like Tqdm Torchvision Torch.

41
00:02:50,000 --> 00:02:52,000
PyTorch and other required libraries.

42
00:02:52,000 --> 00:02:56,000
So it might take few seconds for this channel to run and hide the libraries.

43
00:02:56,000 --> 00:02:58,000
So it installs all the libraries.

44
00:02:58,000 --> 00:03:04,000
If you skip this step to run this cell, some libraries might not be installed and you will face the

45
00:03:04,000 --> 00:03:09,000
issue that causing libraries is not installed when you further run the script like training or the prediction.

46
00:03:09,000 --> 00:03:14,000
So now as we are performing the detection, so now we need to go to the detection folder which is inside

47
00:03:14,000 --> 00:03:15,000
over here.

48
00:03:15,000 --> 00:03:17,000
So just go over here.

49
00:03:18,000 --> 00:03:21,000
So the detection folder contains the prediction training and validation script.

50
00:03:21,000 --> 00:03:28,000
So as we only want to perform prediction over here, we are not training our model, so we are just

51
00:03:28,000 --> 00:03:35,000
predicting or we can say that we are implementing detection and tracking on a PRE-TRAINED model available

52
00:03:35,000 --> 00:03:37,000
on YOLO repository.

53
00:03:37,000 --> 00:03:42,000
So just copy this script path and just paste it over here.

54
00:03:42,000 --> 00:03:47,000
So and just run this cell so we don't need the training or validation script.

55
00:03:47,000 --> 00:03:48,000
We only require the prediction script.

56
00:03:49,000 --> 00:03:52,000
So as we are implementing object tracking using Deepsort.

57
00:03:52,000 --> 00:03:57,000
So we will download the Deepsort files from the Google Drive on which I have placed those files.

58
00:03:57,000 --> 00:03:59,000
So I will unzip the deepsort file.

59
00:04:01,000 --> 00:04:06,000
So I will download a sample video for testing from Google Drive.

60
00:04:08,000 --> 00:04:10,000
It might take a few seconds.

61
00:04:11,000 --> 00:04:12,000
Okay, let's demo videos downloaded.

62
00:04:12,000 --> 00:04:16,000
Let's run the script and see what results do we get.

63
00:04:16,000 --> 00:04:22,000
So now the script is running on the demo video which we have downloaded, which is Test1 dot mp4 and

64
00:04:22,000 --> 00:04:27,000
in the prediction.py script we have the algorithm tracking algorithm implemented and the detections

65
00:04:27,000 --> 00:04:28,000
as well.

66
00:04:28,000 --> 00:04:34,000
So if you want to learn about the tracking algorithm, deepsort tracking algorithm and all, everything

67
00:04:34,000 --> 00:04:41,000
like detections are done or we are integrating Deepsort into our detections script.

68
00:04:41,000 --> 00:04:46,000
So you, I recommend you to please watch the last video tutorial in which I have explained this predict.py

69
00:04:46,000 --> 00:04:48,000
script from the start till the end.

70
00:04:49,000 --> 00:04:50,000
So.

71
00:04:51,000 --> 00:04:55,000
And so you can see that it's dull till 206 frames.

72
00:04:55,000 --> 00:05:02,000
So we are total we have total 942 frames in our video and around to 78 frames have been processed.

73
00:05:02,000 --> 00:05:05,000
And here we can see the detection in each of the frames.

74
00:05:06,000 --> 00:05:10,000
So it might take you a minute or two further.

75
00:05:10,000 --> 00:05:12,000
So to run this script.

76
00:05:12,000 --> 00:05:17,000
So let's wait and see until this script completely runs so we can.

77
00:05:19,000 --> 00:05:20,000
See the results as well.

78
00:05:21,000 --> 00:05:23,000
So it's 484 frames.

79
00:05:23,000 --> 00:05:32,000
509 523 532 546 555 564, 574, 590.

80
00:05:32,000 --> 00:05:34,000
So it will take a minute or two.

81
00:05:34,000 --> 00:05:38,000
So just wait and then it will display this demo video as well.

82
00:05:40,000 --> 00:05:42,000
3678.

83
00:05:43,000 --> 00:05:43,000
Six.

84
00:05:43,000 --> 00:05:44,000
Mind your doors.

85
00:05:44,000 --> 00:05:46,000
706 I'm just pausing the video as it completes.

86
00:05:46,000 --> 00:05:47,000
I will be back.

87
00:05:50,000 --> 00:05:56,000
So the script has done successfully and we have our output in runs detect train folder, which is over

88
00:05:56,000 --> 00:06:01,000
here, runs, detect train folder, and here is our output demo video.

89
00:06:01,000 --> 00:06:04,000
Let's display this output demo video into the Google CoLab.

90
00:06:05,000 --> 00:06:09,000
So I, I've already set the path over here, so just run this cell.

91
00:06:10,000 --> 00:06:16,000
So currently we are not focusing on the tracking and vehicle counting, so I will not explain the script

92
00:06:16,000 --> 00:06:18,000
in this video tutorial.

93
00:06:18,000 --> 00:06:23,000
It will be explained in the next video tutorial when I will explain you the code for the tracking and

94
00:06:23,000 --> 00:06:24,000
vehicle counting.

95
00:06:24,000 --> 00:06:31,000
In this video tutorial we are only focusing on integrating Deepsort object tracking in the YOLO V8.

96
00:06:31,000 --> 00:06:34,000
So let's display our output demo video.

97
00:06:35,000 --> 00:06:37,000
And see what results do we get?

98
00:06:38,000 --> 00:06:42,000
It might take a few seconds, so I will pause the video as it completes bag.

99
00:06:45,000 --> 00:06:47,000
So here is our output demo video.

100
00:06:47,000 --> 00:06:48,000
Okay.

101
00:06:48,000 --> 00:06:49,000
Where it is just disappeared.

102
00:06:50,000 --> 00:06:51,000
Let's wait for a few seconds.

103
00:06:51,000 --> 00:06:52,000
It will appear over here.

104
00:06:52,000 --> 00:06:54,000
As we can download it as well.

105
00:06:54,000 --> 00:06:56,000
Okay, so it's appear over here.

106
00:06:56,000 --> 00:07:00,000
So we can see that detection and tracking has been implemented.

107
00:07:00,000 --> 00:07:05,000
Let's download it and show you on the full screen so you can see the results as well.

108
00:07:05,000 --> 00:07:06,000
So just opening it.

109
00:07:07,000 --> 00:07:08,000
Up here.

110
00:07:08,000 --> 00:07:09,000
Just give me a minute.

111
00:07:09,000 --> 00:07:11,000
Let me shift my screen towards it.

112
00:07:16,000 --> 00:07:18,000
So here is our output demo video.

113
00:07:18,000 --> 00:07:24,000
You can see that we have implemented our detections and the trails we can see also and we can see the

114
00:07:24,000 --> 00:07:25,000
rounded rectangle.

115
00:07:25,000 --> 00:07:31,000
Here is the unique ID of each of the detected object and we can see the unique ID with the trails as

116
00:07:31,000 --> 00:07:31,000
well.

117
00:07:31,000 --> 00:07:34,000
You can see these trails with the bus as well.

118
00:07:34,000 --> 00:07:41,000
We can see each object has a unique ID 148 157 181 and the trails as well.

119
00:07:41,000 --> 00:07:47,000
So in this video tutorial we have implemented object tracking with YOLO V8 in Google CoLab.

120
00:07:47,000 --> 00:07:49,000
See you all in the next video tutorial.

121
00:07:49,000 --> 00:07:50,000
Till then, bye bye.

