You know, 11 is the new state of the art model released by Ultralytics that outperforms all the previous
object detection models, including YOLO B10, YOLO v9, Yolo v eight.
In terms of speed and accuracy, YOLO 11 can be used for a variety of tasks such as object detection,
instance segmentation, image classification, and pose estimation.
In this tutorial, we will look at how we can run YOLO 11 in our windows.
And here you can see the GitHub repo.
So this is the Ultralytics GitHub repo over here.
And here you can see the graph.
So you can clearly see that YOLO 11 models outperforms all the previous object detection model in terms
of speed and accuracy as well.
And here if you want to check the documentation you can click on the link over here.
And YOLO 11 can be used directly in the command line interface with the yellow command, and in this
tutorial we will look at how we can use the other 11 directly in the command line interface with the
yellow command, and you can also set up a Python script, and you can just write down this script and
you can use the other 11 model as well.
But in this tutorial we will see how we can use yellow 11 directly in the command line interface with
the yellow command okay.
And in the later videos we will see how we can set up the Python environment and just set up all the
scripts and we can.
But in this tutorial we will focus on how we can use yellow 11 directly in the command line interface
with the yellow command.
So yellow 11 comes with five different models which include yellow 11 nano yellow 11 small yellow 11
medium yellow 11 large and yellow 11 extra large.
So yellow 11 nano is the fastest among the yellow 11 models, but it is less accurate.
Like you can see over here.
The mean average precision validation is 39.5, while 11 extra large is the most accurate.
As we can see over here, the mean average precision is 54.7, but it is less passed over like it.
Uh, it is not very fast as compared to other YOLO models.
YOLO 11 models.
So there is a trade off between speed and accuracy.
Okay, the other 11 extra large give us the better mean average precision as compared to other 11 models.
But there is a trade off with the speed.
Like, uh, the speed is slow or it is less fast as compared to other YOLO 11 models.
So here we have that.
These are the object detection models.
Here we have the models for segment and segmentation.
And here we have the models for pose estimation.
And here we have all the models for image classification as well.
So you can just check out this repository.
You can check out different examples on the Ultralytics documentation as well.
So let's start writing down the code and see how we can run goto 11 in our windows.
So here you can see I've just opened Anaconda prompt.
You know, if you have installed Anaconda Navigator you can open the Anaconda Navigator.
And over there you can open the Anaconda prompt.
So over here you can see that I have opened the Anaconda prompt.
So the step number one will be to set up the virtual environment.
So in the step number one I will set up a virtual environment.
So to set up the virtual environment I will write conda create python n.
And here we will write the name of the virtual environment.
I will write your 11 um 40 okay.
So this is the name of my virtual environment.
And I will be using Python 3.10 which is stored on my system.
So first of all is we need to set up a virtual environment.
So this will take few seconds to set up the virtual environment.
Going right over here.
So this will take few more seconds.
So let's wait.
So now we need to activate our environment.
So I will write Conda activate.
And the name of my environment is YOLO 11 dash 4d.
So let's run this.
So now now you can see that I have just activated my environment.
And you can see the name over here so we can clear the screen.
Okay.
So now we have set up the virtual environment.
Now in the next step we will set up the YOLO 11.
So we will install the Ultralytics package over here.
So I will just write pip install Ultralytics over here.
So I am installing the Ultralytics package.
So with the Ultralytics package like you can see that many other packages like NumPy, matplotlib,
OpenCV, Python, SciPy, pandas, Seaborn and many other packages also gets installed as well.
Now you can see there are large number of packages which are just getting installed.
So this will take few more seconds.
So now you can see that it's installing all the connected packages.
So they are like many packages that are installed along with the latest package.
So let's wait for a few seconds.
Now you can see that all the packages are installed.
So we can first clear the screen.
And then I will just write Python over here.
I will just write Import torch.
And over here I will just write torch dash version to check the torch version.
So we have 2.4.1 and our I'll keep you on because I don't have GPU available in my local machine.
Then what you can do over here is, uh, with git.
From here we can simply write this git.
And we have.
So if you have a GPU available in your local machine, you can simply write PyTorch dot.
Org from here.
And then you can click on Get started from here.
Okay.
And if you want to install a torch with GPU so you can simply type 2.1.4 over here.
Okay.
And just call same.
And then you can just copy this command from here.
And then you can go back over here and you can just, uh, write this over here as I don't have a GPU
in my machine, so it's of no usage.
So I will simply stop this operation.
But if you have a GPU available in your local machine, then you can simply use torch with GPU.
And after installing or installing this command over here, you can then just write Python over here,
and then you can write Import Torch over here.
And you can.
Simply write torch dot dash dash version.
So currently I don't have a GPU.
So you can clearly see CPU over here.
Uh, but if you have a GPU available in your local machine, like if you have Nvidia GPU available in
your local machine, then you can install GPU version of PyTorch.
So to install GPU version of PyTorch, you just need to simply run this command.
After the installation gets finished.
Then you can simply write Import Torch and you can check the version of torch.
So here you will see that Cuda over here.
So if acuta appears instead of CPU, so it means that you are using GPU version of PyTorch and the CPU
version will be automatically deleted.
Okay.
So we can simply exit from here.
Uh, one thing, uh, I just forgot to tell you.
So you can further check is import torch if you want to check if you have, uh, if the PyTorch GPU
is working.
So one thing you can do is you can write torch dot.
Tilde dot is cache available?
So you can see false because as the GPU is not working.
So you can clearly see false over here.
But if you have a GPU working then you will see true over here as well.
So we can simply exit from here.
And I can just clear the screen.
So let's we have set up everything.
So now what we can do over here is.
We will see how we can do object detection on images and on videos over here.
Okay.
So we will be using YOLO 11 directly in the command line interface with this YOLO command over here.
Okay.
So what we can do over here is we can simply write yolo.
Toss is equal to detect mod is equal to predict okay.
And model is equal to YOLO 11.
We are using YOLO 11 nano model.
And for the source and inside this folder over here YOLO 11 window record.
If I just show you.
So I have added these two images and one videos.
I will use this image dot jpg over here so I can simply write source is equal to image dot zip.
And let's see if you are able to do object detection on this image or not.
So this will take few seconds.
First is installing the YOLO 11 nano model.
In the meanwhile it gets installed.
Let me just.
So you can see that our output is saved into runs detect predict okay.
And we are able to predict one person, one bus, two traffic light, three backpacks and one handbag.
Okay.
And let's go to this folder.
So you can see here we have the runs folder being created.
And inside this we have predict.
And over here.
You can see over here we are able to predict bus person backpack handbag person traffic lights.
So the bus prediction results are quite good.
Okay so let's go back over here.
And similarly we can do object detection on video as well.
What you need to do is instead of source over here you just need to pass the video dot mp4.
So as I'm running on CPU the processing will be very slow, but I will just show you how this works.
So now you can see the complete video is divided into 458 frames.
And we are doing detection.
Object detection on each of the frame one by one.
Okay.
So let's wait for it to get finished.
And then I will show you the output video as well.
For the processing on the video is done.
Let me just show you over here we have predict two and over here we have our output video.
Let me just show you the output video over here.
So over here you can see that we are able to detect person bicycle traffic lights over here.
And we can also able to detect the road signs over here as well.
So the results look very promising.
Like you can see we are able to detect handbag person traffic lights.
So overall the results look quite good.
Okay So we have seen that how we can do object detection on image and video.
Now we will see how we can do instance segmentation or object segmentation on image and video.
So first I will just write down here.
Let's just clear the screen.
Over here I will just write CLS.
And to do object segmentation or instance segmentation I will just write toss is equal to segment over
here.
And I will also write over here.
And the source I will pass the input image over here I will just write image one dot jpg.
So now what we are doing over here is we are doing instance segmentation on this input image over here.
And currently we are using the pre-trained model.
So we are just writing what is equal to predict.
And we are doing the prediction using the pre-trained model.
Okay.
So it's done.
And results of a model is equal to segment mod is equal to predict.
Okay let's see.
So it's doing object detection I might have made a mistake.
So let me just see.
Source is equal to segment mod is equal to okay.
So basically I'm using object detection model I need to use a segmentation model.
That is the mistake.
So if you just go over here and see we have the segmentation model I need to use this model I was using
direct Object detection model.
Therefore I was just getting this issue.
So hopefully this issue will be sorted out.
So let's see.
This will take few seconds.
So now first downloading and downloading the segmentation model.
As you can clearly see over here.
Now its results are saved in segment predict folder.
And let me just go towards this folder.
And here you can see we have the segmentation folder and the predict.
And here you can see we have the output image.
So now you can see that we are able to do instance segmentation on bus traffic light person handbag
backpack.
And the results look quite impressive.
Like you can see these are the instance segmentation results.
And the results look quite promising as well.
And to do instance segmentation on videos, what you can do is you can simply replace the source with
the name of the video, a file name like video or mp4, I will not go towards it because I'm just running
it on CPU and the processing on CPU takes a lot of time.
So we have seen that how we can do object detection and instance segmentation.
Now we will see how we can do both estimation on image and video.
So to do pose estimation first of all what I will just clear the screen over here and we can just update
our this is um toss will be equal to pose now and we will be using YOLO.
Post model over here and over here.
What we can use we can use simply this image that's what.
Let's see if we are able to do pose estimation on this input image or not.
So this will take few seconds before it explodes, downloading the YOLO 11 pose estimation model.
So now you can see that your 11th pose estimation model is downloading.
And we are able to do pose estimation on this input image.
So let me just go over here and you can see the pose folder over here.
And here you can see that.
So now you can see that we are able to do pose estimation on this input image.
So YOLO 11 pose estimation model is being trained on the for the person poses.
So it will only detect pose for the person.
And if you want to detect uh, the pose estimation for any element or for any object, you need to fine
tune the YOLO 11 model.
Okay, because YOLO 11 pose estimation model is being trained to do pose estimation of only person.
And if you want to do pose estimation of any object or any animal, you need to fine tune the YOLO 11
pose estimation model.
Okay.
And in the same way we can also we will also see how we can do, uh, for estimation on our video.
So we can simply right over here video dot mp4.
So now we are doing pose estimation using YOLO 11 pose estimation model on the input video.
So this will take quite some time.
Like you can see over here.
The complete video is being divided into 458 frames.
And the processing on each of the frame is done one by one.
So let's wait for it to get finished.
And then I will show you the output video as well.
So the processing on this input video is done.
So I will just go over here and open the predict to folder over here.
And let's see if we are able to do all the estimation on this input video or not.
So now you can see that we are able to do the detection and pose estimation as well.
So you can see the results look quite promising.
Like you can see we are able to detect the person.
And we are also able to do the pose estimation as well.
Okay, so now we are left with only one task which is classification like image classification.
So what we can do is first I will just clear the screen and I will just write over here.
Task is equal to classify I think this is correct.
And um we will use uh classification.
Okay.
Let me just check it once.
Okay.
Uh, for the classification we have SNS, so why not use the extra large model X CLS and I will just
pass the car image.
So what's the spelling or the car image?
That's in the PNG or JPEG that's in the picture.
That works for image dot.
So let's run this.
So first it will download this model.
Uh let's see.
Now you can see the model is downloading.
The size of the model is 6.9.
Like the YOLO and YOLO 11.
Extra large model is ten times larger in size than the YOLO 11 nano model.
YOLO 11 nano model is around 5.69 MB, and your 11 extra large model is 56.9 MB.
So it's around ten times enlarged in size as compared to the YOLO 11 nano model.
So now you're done and you can see we have saved our result in runs classifier.predict.
So if we just go over here and predict, let's see how it works.
So over here you can see that if you can zoom in the screen.
So you can clearly see over here the model has given me like the splits.
The model is 66% confident that the sports car and yes this is a sports car, while the model is, uh,
11% confident that this the car will 10% confident that is the cap and only 3% confident that this is
a racer.
So like 66% the model is confident that this is the sports car.
So we are just getting impressive results.
So in this tutorial we have seen that how we can run Dx11 in windows.
And we have seen that how we can run YOLO 11 directly in the command line interface with the YOLO command.
So that's all from this tutorial.
Thank you for watching.