Episode 1 | Object Detection with Pre-trained Ultralytics YOLOv8 Model

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to the new video with ultralytics we're going to create a whole playlist with a bunch of resources about ultralytics and also YOLO V8 so we're both going to see how we can do update detection optic segmentation and all those different things we're both going to use pre-trained models and also use our own custom trained models we're going to see how we can set up the data set go over the GitHub repository the documentation and so on and then you will basically learn how to use the whole YOLO V8 framework so in the first video here we're going to focus on how we can use a pre-trained yellow V8 model so first of all let's jump into the GitHub repository let's go over the yellow V8 model get an overview over how we can use it for update detection before we're going to jump into the documentation to see how we can set it up the different camera arguments and how we can use pre-trained yellow V8 models for optic detection to start with the show like the inference speed and also the accuracy and compared to the other YOLO models where we can see that this is actually like state of the art of the other YOLO model state that they compare it to so we can see the yellow V8 model it has really good accuracy and it's also like faster compared to some of the other yellow models so this is a really nice trade-off between accuracy and speed so basically we can just run through it we can see some of the documentation how to PIV install it and so on so we're going to install it on our local machine see how we can use this from the terminal and also how we can use it in Python script so yeah they showed some examples they also show some models we are going to do both detection segmentation you can also do tracking with yolo V8 so that is really good if you want to track Optics over time we can also do Post estimation all of those things we're going to cover that in future videos in this new playlist that we're creating together with ultralytics so we'll start with just copy pasting this command here into the command line I'm going to open up an anaconda prompt just to see like if you guys just want to run inference directly you can pass in either like a URL you can pass in an image file video file video stream and all those different things also if you have a live webcam you can just directly throw it into it as a source and then you can run it directly from your terminal if you just want to extract the results and save them in folders so yeah we just go into that inside the Anaconda prompt copy paste the command YOLO predict so we have different kind of like tasks that we can perform with the yellow models but we just have this yellow command that we can run and then we just need to specify the model they also want to run we can either use like the Nano model the small model large model and so on let's just go with the small one this is the cable and then we just throw in the source so the URL to the image that we want to do inference on so let's just run it here we can see that we detected as single pass and four persons in the image we can see the inference speed and so on and also that the results are saved to this directory so yeah we can see that we are detecting a bus and then also detect four persons even though like we can only see the leg of one person here it's still detected with a pretty high confidence score we can also see if we detect the person here so again we have the record predictions here when we're just using pretend models from the covert data sets so those are the classes that we can do predictions on with the pre-trained models from the Coco data set so we're not going into Visual Studio code I'm going to show you how we can just set it up with a couple of lines here are in our own python script so first of all from ultralytics We need to import YOLO we can just set up a create an instance of our YOLO V8 model again we just specify what type of model we want to use it creates an instance of that model and it also downloads the weight so you don't have to do anything and you can actually do interference directly with only two lines of code then we can also just do an inference here so we do just do it like a forward pass in our model we can specify a number of parameters that we can go inside the documentation and see so we can specify the source it can be like an image a video file you can also specify like a camera index if you want to run like real time inference on a webcam for example here we can also specify that we want to show the results while we act like doing the inference we can set a confidence score and we can also save the results if we want to do it so the good thing here is that it actually just returns a generator of the results update so you can go in and extract the results all the time so let's just run this directly I have a file here called gymnast.mp4 so this is just a video file that we can do inference on so here we can see the inference results we can see that we're detecting the persons in the frame sometimes we also detect some kites but again we made some detections here and there because we're not running optic tracking yet but we're going to cover that in another video so we can actually track Optics around in the frame okay so we only need two lines of code to be able to do inference with the YOLO V8 model from ultralytics so let's now go inside the documentation and take a look at some of the arguments because those are the most important ones when you're actually going to run fairings if it's either like a pre-trained model or also custom models again in other videos we're going to see how we can do custom up detection tracking post estimation and all those different kind of things so first of all here you can just see like a short introduction to the yellow V8 model let's just jump straight into their modes so they both have a train mode validation predict export track and also Benchmark mode Let's go inside the prediction mode so first of all here inside the prediction mode you can just see like how we connect like extracted results so when we actually have this generator return you can go in and extract the results directly in your own code so this this will basically just be what you need to add and then you can extract both the bounding boxes confidence scores classes and so on we also have the inference resources here so it talked about that shortly throughout the video so we can both pass in an image URL screenshot pil opensv numpy torch is the video directory Club YouTube stream so we can basically just pass in everything into the function and then also one of the other important things if not the most important thing the inference arguments that we can actually throw into the predictive function so here we see that we actually like specify the source we also did the confidence score you can also specify like an intersection over Union we can also specify if you want to use like half Precision the device that we want to use so if you have a TPU available you can use that or else if it runs on the CPU you can specify that if you don't specify anything it will just like detect it automatically so you can go in and check the documentation for your specific use case they have some really good documentations it is easy to go through there's not a lot of text and they have a lot of tables and examples how you can actually use the yellow V8 models and also all the different kind of like arguments so the last cool feature I want to show you guys is how we can run inference with a pre-trained jewelry model on a live webcam so now we basically just need to specify our source index so it's just right now and now we should be able to do live interference with a webcam there we go now we have the webcam up and running and now we should actually be able to get predictions I'll just take the webcam up and then you can actually see that we get the predictions we have a person mouse keyboard we get some really nice results we can see the detection so we can see all the detections we can also see the inference speed so it is actually like around like 10 milliseconds on average here as we can see so that is around 100 frames per second so we can actually use these pre-trained models to do live update detection run it real time with over 100 frames per second so this is just awesome let's go in and see some of the other results I'll just point it around see detects me a person pretty nice we have the chair in the background we should also be able to get the Potted Plant so yeah we can see we have the powder plant we have a donut here in the background which is the dock bed so that's kind of funny so thank you guys for watching this video here I hope you learned a ton on how your connect like use the pre-trained Dual over 8 models it is straightforward I'm looking for it and really excited for the upcoming videos in this tutorial and the playlist where we're going to see how we can use all these different kind of like resources models custom optic detection optic tracking and all those different things with the ultralytics framework I hope you had an awesome time I hope to see you in one of future videos bye for now
Info
Channel: Ultralytics
Views: 17,597
Rating: undefined out of 5
Keywords: Ultralytics, AI, Artificial Intelligence, Object Detection, YOLOv5, YOLOv8
Id: 5ku7npMrW40
Channel Id: undefined
Length: 7min 31sec (451 seconds)
Published: Wed Jul 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.