1
00:00:02,000 --> 00:00:08,000
In the previous part we have seen that how we can integrate YOLO V8 with flask and run on a video.

2
00:00:08,000 --> 00:00:12,000
So now we will see that how we can run on a live webcam feed.

3
00:00:12,000 --> 00:00:20,000
So to run on the live webcam feed, just change in the video path in the path dash x to zero.

4
00:00:20,000 --> 00:00:22,000
So I will just end this out.

5
00:00:23,000 --> 00:00:26,000
And in in this if just uncomment it.

6
00:00:26,000 --> 00:00:32,000
So now you can see over here in the path dash x I have just entered zero and I have just removed this

7
00:00:32,000 --> 00:00:34,000
part of the video path.

8
00:00:34,000 --> 00:00:38,000
I will have just removed the video path from here and just replaced it with zero.

9
00:00:38,000 --> 00:00:45,000
So by replacing this video path with zero, we will be able to run this on the live web can see it.

10
00:00:45,000 --> 00:00:50,000
So in the previous video we have already seen that how we can integrate YOLO V8 with flask.

11
00:00:50,000 --> 00:00:56,000
So by just replacing the video path with zero, we will be able to run this on the live webcam feed.

12
00:00:56,000 --> 00:01:01,000
So just write python just so now just run this script.

13
00:01:01,000 --> 00:01:03,000
Python flask app.py file.

14
00:01:03,000 --> 00:01:07,000
And now we will be able to run this on the live webcam feed.

15
00:01:07,000 --> 00:01:10,000
So this might take few seconds as well.

16
00:01:10,000 --> 00:01:11,000
So.

17
00:01:12,000 --> 00:01:14,000
Next, we just click out this part.

18
00:01:14,000 --> 00:01:14,000
Okay.

19
00:01:16,000 --> 00:01:20,000
Uh, before I just run this, let me just stop this from here.

20
00:01:20,000 --> 00:01:23,000
And instead of doing this, let me just.

21
00:01:24,000 --> 00:01:26,000
Rent this out and uncomment this.

22
00:01:26,000 --> 00:01:30,000
Let's create a new URL to run this on a live webcam feed.

23
00:01:31,000 --> 00:01:33,000
So just copy this from here.

24
00:01:34,000 --> 00:01:35,000
And.

25
00:01:36,000 --> 00:01:41,000
Just right here where care and just replace this path with zero.

26
00:01:41,000 --> 00:01:46,000
So if we just replace this path with zero, we will be able to run this on live webcam feed.

27
00:01:46,000 --> 00:01:49,000
So I've just replaced the video path with zero.

28
00:01:49,000 --> 00:01:55,000
So instead of just accommodating into the video URL, I have just created another URL by the name webcam.

29
00:01:55,000 --> 00:02:03,000
So here using apt route method, I've just created a webcam, so and just in the path dash x, I have

30
00:02:03,000 --> 00:02:09,000
just removed this video path and added zero so that I will be able to run this on the live webcam feed.

31
00:02:10,000 --> 00:02:11,000
So just run this now.

32
00:02:13,000 --> 00:02:16,000
Well, now, when will this call this webcam?

33
00:02:16,000 --> 00:02:20,000
I will be able to run this on the live webcam feed and do the detections.

34
00:02:21,000 --> 00:02:22,000
Or what is the error?

35
00:02:22,000 --> 00:02:25,000
Okay, so we just need to change this function.

36
00:02:25,000 --> 00:02:28,000
We cannot have two functions by the same name like we do.

37
00:02:28,000 --> 00:02:30,000
So now just run this again.

38
00:02:31,000 --> 00:02:35,000
So now we are just running the class app.py file.

39
00:02:35,000 --> 00:02:40,000
So now we see that we are able to do the detections on the live webcam feed or not.

40
00:02:40,000 --> 00:02:49,000
So just copy this URL from here, copy URL and just go over here and just write this and dash webcam

41
00:02:49,000 --> 00:02:53,000
and see if we are able to detect the detections on the live webcam feed or not.

42
00:02:54,000 --> 00:02:57,000
So let's see, how does it work?

43
00:02:57,000 --> 00:02:59,000
So I'm just also waiting with you.

44
00:03:02,000 --> 00:03:07,000
And now you can see over here we are able to track actions on the live webcam feed.

45
00:03:07,000 --> 00:03:07,000
Okay.

46
00:03:07,000 --> 00:03:15,000
So you can see over here, you can see that a bounding box around me and the label person with the confidence

47
00:03:15,000 --> 00:03:16,000
score of here as well.

48
00:03:20,000 --> 00:03:21,000
We'll wait and see that.

49
00:03:22,000 --> 00:03:26,000
Now, you can see here on the back side have the sofa and it's directing as the sofa.

50
00:03:27,000 --> 00:03:27,000
Okay.

51
00:03:27,000 --> 00:03:30,000
And here I have the tab is able to retract the tab or not.

52
00:03:30,000 --> 00:03:31,000
Let's see.

53
00:03:32,000 --> 00:03:38,000
Well, now you can see over here, it's directing the tablet as the laptop, although it's a tablet.

54
00:03:38,000 --> 00:03:40,000
So that's okay as well.

55
00:03:40,000 --> 00:03:45,000
So now you can see over here, it's working quite fine on the live webcam feed as well.

56
00:03:45,000 --> 00:03:51,000
We can can see that on the bounding box around me and the paper as well.

57
00:03:51,000 --> 00:03:53,000
So the results are good.

58
00:03:53,000 --> 00:03:53,000
Okay.

59
00:03:55,000 --> 00:04:00,000
So now you can see over here we are able to run this on the live webcam feed as well.

60
00:04:00,000 --> 00:04:02,000
And the results are quite impressive.

61
00:04:02,000 --> 00:04:09,000
So if you just want to run on video, so just need to go over here and we'll just refresh this, the

62
00:04:09,000 --> 00:04:15,000
URL we have already added, so we'll just refresh this dash video URL and see if you are able to do

63
00:04:15,000 --> 00:04:17,000
the detections on the video or not.

64
00:04:17,000 --> 00:04:24,000
So now if I just call this dash video, you can see over here we are able to do detections on the video.

65
00:04:24,000 --> 00:04:30,000
So you can see over here we have drawn the bounding box around the person with the label and the confidence

66
00:04:30,000 --> 00:04:30,000
score.

67
00:04:30,000 --> 00:04:36,000
And we have drawn the bounding box around the bicycle with the label bicycle and the confidence score

68
00:04:36,000 --> 00:04:37,000
over here as well.

69
00:04:37,000 --> 00:04:38,000
So that's quite impressive.

70
00:04:38,000 --> 00:04:40,000
We have also detected a traffic light.

71
00:04:40,000 --> 00:04:44,000
We have drawn the bounding box and here we have a label traffic light.

72
00:04:44,000 --> 00:04:50,000
So now you can see over here we are here we are getting that car and we have a label car and we have

73
00:04:50,000 --> 00:04:52,000
the confidence score over here as well.

74
00:04:52,000 --> 00:04:57,000
And here we are just getting the person and we have the confidence score.

75
00:04:57,000 --> 00:04:59,000
And here we are also detecting the motorbike.

76
00:04:59,000 --> 00:05:02,000
We have the label motorbike and the confidence score as well.

77
00:05:02,000 --> 00:05:09,000
So now we have seen that how we can integrate YOLO V8 with Flask and do the detections on the video

78
00:05:09,000 --> 00:05:11,000
or live webcam feed as well.

79
00:05:11,000 --> 00:05:17,000
So we have integrated YOLO V8 with flask and I was able to detections on video and on the live webcam

80
00:05:17,000 --> 00:05:18,000
feed.

81
00:05:18,000 --> 00:05:25,000
So now in the next video we will see that how we can create an HTML page and make this more.

82
00:05:26,000 --> 00:05:33,000
If you like, we can talk again further, polish this and create a complete HTML web page and do the

83
00:05:33,000 --> 00:05:34,000
styling using CSS.

84
00:05:34,000 --> 00:05:36,000
So see you all in the next part.

