1
00:00:02,000 --> 00:00:03,000
Hello everyone.

2
00:00:03,000 --> 00:00:06,000
In this video tutorial we will see what we can use.

3
00:00:06,000 --> 00:00:12,000
YOLO V8 with Deepsort object tracking to do vehicle counting, we will count the number of vehicles

4
00:00:12,000 --> 00:00:16,000
entering as well as the number of vehicles leaving the lane.

5
00:00:16,000 --> 00:00:19,000
So in front of you you can see the output video demo over here.

6
00:00:19,000 --> 00:00:25,000
So in your question might be in your mind like how we have implemented the object tracking.

7
00:00:25,000 --> 00:00:31,000
So you can see that in object tracking, we assign a unique ID with each of the detected object like

8
00:00:31,000 --> 00:00:32,000
you can see here.

9
00:00:32,000 --> 00:00:34,000
Here we have the detected a car.

10
00:00:34,000 --> 00:00:37,000
A unique ID 130 is assigned with the car.

11
00:00:37,000 --> 00:00:39,000
Plus we also have the trails as well.

12
00:00:39,000 --> 00:00:41,000
Now, here we also detected the car.

13
00:00:41,000 --> 00:00:44,000
You can see the unique ID 125 with the car.

14
00:00:44,000 --> 00:00:47,000
And you can see these trails as well.

15
00:00:47,000 --> 00:00:48,000
You can see these are the trails.

16
00:00:48,000 --> 00:00:55,000
And here you can see that we have detected the truck and we have assigned the unique ID 127 to the truck.

17
00:00:55,000 --> 00:00:57,000
And here you can see the trails as well.

18
00:00:57,000 --> 00:01:02,000
You can see the trails line as well, which you can see over here, the brown line.

19
00:01:02,000 --> 00:01:06,000
These are the trails which we have drawn here in the you can see the light pink color.

20
00:01:06,000 --> 00:01:08,000
These are the trails which we have drawn.

21
00:01:08,000 --> 00:01:09,000
Okay.

22
00:01:09,000 --> 00:01:14,000
So using object tracking, we have assigned a unique ID to each of the detected object.

23
00:01:14,000 --> 00:01:16,000
Plus you can see these trails as well.

24
00:01:16,000 --> 00:01:23,000
So let's go towards the in more detail and let me explain you what a bit more theoretical details then

25
00:01:23,000 --> 00:01:24,000
we can go towards the export part.

26
00:01:25,000 --> 00:01:25,000
Okay.

27
00:01:25,000 --> 00:01:29,000
So let me share my screen and open the direction in Compass.

28
00:01:29,000 --> 00:01:32,000
So in front of your screen you can see the Direction Compass.

29
00:01:32,000 --> 00:01:37,000
So you all know that here we have the north direction, Here is the south direction, here is the east

30
00:01:37,000 --> 00:01:40,000
direction and here is the west direction.

31
00:01:40,000 --> 00:01:46,000
So please remember these direction compass in your mind and let's move towards the another image so

32
00:01:46,000 --> 00:01:48,000
that I can explain you the remaining concept as well.

33
00:01:51,000 --> 00:01:54,000
So if I open the other image, just give me a minute.

34
00:01:54,000 --> 00:01:56,000
I'm just opening the other image.

35
00:01:56,000 --> 00:01:58,000
So here in the image.

36
00:01:58,000 --> 00:02:01,000
So now you can see the other another image on your screen.

37
00:02:01,000 --> 00:02:07,000
So what we can say that if the vehicle is moving in this direction, like you can see over here, let

38
00:02:07,000 --> 00:02:10,000
me just pick up the pencil over here.

39
00:02:10,000 --> 00:02:15,000
So what we can say that if the vehicle is moving in this direction, we can say that this is the north

40
00:02:15,000 --> 00:02:15,000
direction.

41
00:02:16,000 --> 00:02:16,000
Okay.

42
00:02:16,000 --> 00:02:21,000
So if the vehicle is moving in this direction, we can say that this is a north direction.

43
00:02:21,000 --> 00:02:26,000
And if the vehicles moves in this direction, we can say that this is the south direction.

44
00:02:26,000 --> 00:02:32,000
So we are just, uh, this is as per the direction compass which we have seen in the previous image.

45
00:02:32,000 --> 00:02:35,000
So this is a north direction and this is the south direction.

46
00:02:35,000 --> 00:02:41,000
So when the vehicles move in this north direction, we can say that this is a vehicle is entering.

47
00:02:41,000 --> 00:02:47,000
And when the vehicle moves in this south direction over here, we can say that the vehicle is leaving.

48
00:02:47,000 --> 00:02:51,000
So when the vehicle moves in the south direction, we can say the vehicles is leaving.

49
00:02:51,000 --> 00:02:55,000
And when the vehicles move in the north direction, we can say the vehicle is entering.

50
00:02:56,000 --> 00:02:56,000
Okay.

51
00:02:56,000 --> 00:03:02,000
So how we can how does the model knows that the vehicle is moving in the north direction or the south

52
00:03:02,000 --> 00:03:03,000
direction?

53
00:03:03,000 --> 00:03:06,000
So what we do is you can see these trails over here.

54
00:03:06,000 --> 00:03:09,000
You can see that these are the trails line, the light blue line.

55
00:03:09,000 --> 00:03:11,000
These are the trails line over here.

56
00:03:11,000 --> 00:03:14,000
So when this trails line so.

57
00:03:15,000 --> 00:03:16,000
Model judges.

58
00:03:16,000 --> 00:03:20,000
If the vehicle is moving in the north or the south direction by using this trails line.

59
00:03:20,000 --> 00:03:20,000
Okay.

60
00:03:20,000 --> 00:03:26,000
So when these trails line are moving in the north direction, when these trails are in the north direction.

61
00:03:26,000 --> 00:03:27,000
Okay.

62
00:03:27,000 --> 00:03:32,000
And so we can say that the vehicle is entering, the number of vehicles are entering.

63
00:03:32,000 --> 00:03:37,000
And when these trails are in the south direction, we can say that the vehicles are leaving.

64
00:03:37,000 --> 00:03:43,000
So when these trails, like these trails like intersect with this line, this is the green line which

65
00:03:43,000 --> 00:03:44,000
I have drawn by myself.

66
00:03:44,000 --> 00:03:51,000
So when this trails line intersect with this line, green line, we can we increment the count like

67
00:03:51,000 --> 00:03:59,000
so as when this truck, for example, when this truck trail intersect with this green line over here,

68
00:03:59,000 --> 00:04:02,000
green line over here, then we will increment the counter.

69
00:04:02,000 --> 00:04:05,000
That truck is added and the count as well.

70
00:04:05,000 --> 00:04:11,000
Or when the car when the car trails intersect with this line, green line, we can increment the car

71
00:04:11,000 --> 00:04:12,000
count over here.

72
00:04:12,000 --> 00:04:18,000
When the car when the truck intersect with when the truck trails intersect with this line, green line,

73
00:04:18,000 --> 00:04:21,000
we can increment the truck count over here.

74
00:04:21,000 --> 00:04:25,000
And when the car trails intersect with this line, we can increment the car count over here.

75
00:04:26,000 --> 00:04:26,000
Similarly.

76
00:04:27,000 --> 00:04:32,000
When this trails over here are moving in the south direction over here, south direction.

77
00:04:32,000 --> 00:04:38,000
And when the trails intersect with this green line, then we can increment the car count.

78
00:04:38,000 --> 00:04:43,000
For example, if the car trail is intersecting with this line, then we can increment the car, count

79
00:04:43,000 --> 00:04:44,000
that the cars are leaving.

80
00:04:44,000 --> 00:04:50,000
And if the truck trails intersect with this line, then we can increment the truck, count that the

81
00:04:50,000 --> 00:04:51,000
truck is leaving.

82
00:04:51,000 --> 00:04:55,000
Okay, So in this way, I have explained the theoretical concept.

83
00:04:55,000 --> 00:04:58,000
Let's move towards the code part and explore some new things.

84
00:04:58,000 --> 00:05:00,000
Let's go towards it.

