1
00:00:02,000 --> 00:00:03,000
All right, guys.

2
00:00:03,000 --> 00:00:06,000
So now I will test my model on a live webcam.

3
00:00:06,000 --> 00:00:09,000
So I have downloaded the best weights file from here.

4
00:00:09,000 --> 00:00:16,000
So I will open PyCharm and write down the strip to test my model on the live webcam.

5
00:00:16,000 --> 00:00:20,000
So I am just opening PyCharm and it might take few seconds.

6
00:00:20,000 --> 00:00:22,000
So the PyCharm has opened.

7
00:00:22,000 --> 00:00:30,000
Now I will go to file and create a new project, so I will click on file from here and create a new

8
00:00:30,000 --> 00:00:30,000
project.

9
00:00:31,000 --> 00:00:34,000
And from here I will select the location.

10
00:00:34,000 --> 00:00:38,000
And from here this is in my book.

11
00:00:38,000 --> 00:00:42,000
So here I will select this folder to test my model on the live webcam.

12
00:00:42,000 --> 00:00:46,000
So I will select the live webcam folder and click on.

13
00:00:46,000 --> 00:00:46,000
Okay.

14
00:00:47,000 --> 00:00:49,000
And then I will.

15
00:00:49,000 --> 00:00:51,000
Environment directory is not empty.

16
00:00:51,000 --> 00:00:56,000
Okay, so let us create a new folder over here.

17
00:01:00,000 --> 00:01:02,000
Webcam testing.

18
00:01:03,000 --> 00:01:03,000
Okay.

19
00:01:07,000 --> 00:01:13,000
I have created a folder by the name webcam testing and in the light webcam I have placed my best weights

20
00:01:13,000 --> 00:01:20,000
file and prediction, so I will just copy those two files from here and paste in the webcam testing.

21
00:01:20,000 --> 00:01:23,000
So best weights file is the my model weights file.

22
00:01:23,000 --> 00:01:31,000
Best fit is by basically my model weights file and predictions.py the script to test my model on the

23
00:01:31,000 --> 00:01:32,000
live webcam.

24
00:01:32,000 --> 00:01:33,000
Okay.

25
00:01:33,000 --> 00:01:38,000
So just opening PyCharm and just selecting this folder.

26
00:01:38,000 --> 00:01:39,000
So webcam testing.

27
00:01:39,000 --> 00:01:40,000
Okay.

28
00:01:40,000 --> 00:01:42,000
And creating a new project.

29
00:01:42,000 --> 00:01:48,000
So selecting this window and let's see what results do we get.

30
00:01:48,000 --> 00:01:51,000
Okay, so it's creating a virtual environment.

31
00:01:51,000 --> 00:01:53,000
So opening predictions.py.

32
00:01:54,000 --> 00:02:00,000
So in the first step I am importing YOLO from the ultralytics, then importing v2.

33
00:02:00,000 --> 00:02:08,000
So in the in this model variable name I am calling YOLO weights and YOLO model and passing the best

34
00:02:08,000 --> 00:02:09,000
paid weights file.

35
00:02:09,000 --> 00:02:12,000
So this here we have the predict method.

36
00:02:12,000 --> 00:02:13,000
So predict methods.

37
00:02:13,000 --> 00:02:16,000
Take all the parameters of the command line interface.

38
00:02:16,000 --> 00:02:21,000
So as I'm testing my model on the live webcam of my laptop so I have selected source zero and show is

39
00:02:21,000 --> 00:02:27,000
equal to true means because I want to display the results live and I have selected the confidence value

40
00:02:27,000 --> 00:02:28,000
as 0.15.

41
00:02:28,000 --> 00:02:34,000
So model will display all the predictions or the bounding boxes where we have confidence value till

42
00:02:34,000 --> 00:02:38,000
0.5 below confidence value 0.15.

43
00:02:38,000 --> 00:02:42,000
The model will not display bounding boxes or labels or you can say predictions.

44
00:02:42,000 --> 00:02:45,000
So let's test our model on the webcam.

45
00:02:45,000 --> 00:02:47,000
So I will write over here.

46
00:02:48,000 --> 00:02:48,000
I thought.

47
00:02:50,000 --> 00:02:51,000
Their addictions.

48
00:02:52,000 --> 00:02:52,000
Dot.

49
00:02:54,000 --> 00:02:58,000
I and click on Enter and see what results do we get.

50
00:02:59,000 --> 00:03:00,000
So.

51
00:03:01,000 --> 00:03:04,000
It might take a few seconds to open the webcam.

52
00:03:04,000 --> 00:03:07,000
So then see what results do we get?

53
00:03:07,000 --> 00:03:10,000
Okay, so here I have the resistor in front of me.

54
00:03:11,000 --> 00:03:14,000
Or just I'm just going back with to back.

55
00:03:15,000 --> 00:03:16,000
So.

56
00:03:17,000 --> 00:03:21,000
So our model is you can see that detecting that there is a bug.

57
00:03:21,000 --> 00:03:21,000
So.

58
00:03:22,000 --> 00:03:23,000
In case a book.

59
00:03:23,000 --> 00:03:24,000
It's working fine.

60
00:03:25,000 --> 00:03:28,000
Okay, so one model is able to detect there is a book.

61
00:03:28,000 --> 00:03:34,000
So let's me pick up my another register and see what results do we get over here.

62
00:03:34,000 --> 00:03:37,000
So here it's also detecting that there is a book.

63
00:03:37,000 --> 00:03:43,000
So our model is detecting book verifying like if our model is able to detect that there is a book while

64
00:03:43,000 --> 00:03:46,000
in case of ballpoint, we will see that whether restricting or not.

65
00:03:49,000 --> 00:03:49,000
Okay.

66
00:03:49,000 --> 00:03:52,000
In case of ballpoint point, our strategic predictions are not very fine.

67
00:03:52,000 --> 00:03:54,000
Like our model is unable to detect it.

68
00:03:55,000 --> 00:04:01,000
Have only single ballpoint at this time, so can just test it over from this while in case of work.

69
00:04:01,000 --> 00:04:06,000
Our model works very fine and it is able to detect that there is a book you can see over here.

70
00:04:06,000 --> 00:04:09,000
So let's let's see you on in the next project.

71
00:04:10,000 --> 00:04:11,000
Till then, bye bye.

72
00:04:11,000 --> 00:04:12,000
See you all in the next video.

