All right, guys.
So now I will test my model on a live webcam.
So I have downloaded the best weights file from here.
So I will open PyCharm and write down the strip to test my model on the live webcam.
So I am just opening PyCharm and it might take few seconds.
So the PyCharm has opened.
Now I will go to file and create a new project, so I will click on file from here and create a new
project.
And from here I will select the location.
And from here this is in my book.
So here I will select this folder to test my model on the live webcam.
So I will select the live webcam folder and click on.
Okay.
And then I will.
Environment directory is not empty.
Okay, so let us create a new folder over here.
Webcam testing.
Okay.
I have created a folder by the name webcam testing and in the light webcam I have placed my best weights
file and prediction, so I will just copy those two files from here and paste in the webcam testing.
So best weights file is the my model weights file.
Best fit is by basically my model weights file and predictions.py the script to test my model on the
live webcam.
Okay.
So just opening PyCharm and just selecting this folder.
So webcam testing.
Okay.
And creating a new project.
So selecting this window and let's see what results do we get.
Okay, so it's creating a virtual environment.
So opening predictions.py.
So in the first step I am importing YOLO from the ultralytics, then importing v2.
So in the in this model variable name I am calling YOLO weights and YOLO model and passing the best
paid weights file.
So this here we have the predict method.
So predict methods.
Take all the parameters of the command line interface.
So as I'm testing my model on the live webcam of my laptop so I have selected source zero and show is
equal to true means because I want to display the results live and I have selected the confidence value
as 0.15.
So model will display all the predictions or the bounding boxes where we have confidence value till
0.5 below confidence value 0.15.
The model will not display bounding boxes or labels or you can say predictions.
So let's test our model on the webcam.
So I will write over here.
I thought.
Their addictions.
Dot.
I and click on Enter and see what results do we get.
So.
It might take a few seconds to open the webcam.
So then see what results do we get?
Okay, so here I have the resistor in front of me.
Or just I'm just going back with to back.
So.
So our model is you can see that detecting that there is a bug.
So.
In case a book.
It's working fine.
Okay, so one model is able to detect there is a book.
So let's me pick up my another register and see what results do we get over here.
So here it's also detecting that there is a book.
So our model is detecting book verifying like if our model is able to detect that there is a book while
in case of ballpoint, we will see that whether restricting or not.
Okay.
In case of ballpoint point, our strategic predictions are not very fine.
Like our model is unable to detect it.
Have only single ballpoint at this time, so can just test it over from this while in case of work.
Our model works very fine and it is able to detect that there is a book you can see over here.
So let's let's see you on in the next project.
Till then, bye bye.
See you all in the next video.