We validated the model.
Now let's test our model and make the predictions.
I prepared this image.
I take it from um, from my mobile and it's not included in my data set.
So drag and drop it to here.
It's called new image dot jpg.
By the way, did you notice that U11 and U11 YOLO version eight and the files are included?
Actually we are going to use the YOLO version uh eight and DT for training.
And this is what we've used in the previous videos.
Now let's test our image.
This is new image dot jpg.
It's including uh, a battery.
Now let's test the model and see if it will detect the battery or not.
To make the predictions let me start with ultra.
Let's import YOLO and load the model.
Model equals to YOLO Content.
As I told you, we need to use our trained model.
The trained model is called best.
Copy the path and paste it here.
Like this okay, now model dot predict.
We're going to use the predict function for predicting the object on our new Image.jpg copy path.
Copy path of this image and paste it here.
Okay.
Then what we need to add is some parameters.
Save equals to true.
We need to save it to the content and image size.
We can set it to 640.
It's good.
And the confidence display a confidence.
If there is a detection greater than 40% you can increase this up to 100%.
Okay, so here I am telling a YOLO model that we created here.
Inside the runs detect strain and waits.
Best pity.
Go and examine this new image.jpg.
If it contains any object, and the confidence of your detection is greater than 50%, go and detect
it.
Draw a box around it and save it.
Let me run and see.
And here we go.
Results saved to content.
Let me go up.
Content.
Run, run.
Detect and predict.
You see?
New folder.
Predict is created.
There is a new image.
Let me open it.
And here we go.
Guys, this is the prediction.
Battery a box drawn around this.
And the percentage of or the confidence is 0.95 which is 95%.
Okay so congratulations guys for detecting this object using the trained model.
This is how we train the models.
How to train a custom model in YOLO.