Video object detection using Yolov8 CLI | object detection in video using Google Colab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone so in this particular video we will try to implement YOLO V8 on a video on Google collab so the first thing that you need to make sure is that you have the file in your Google collab so I have the cars.mp4 as you can see the next thing that you want to make sure is that you are using GPU because this will take a lot of time if you are not using GPU or if you are using CPU so the first thing that you need to do is actually pip install ultralytics Ultra lytics and then we'll be passing Dash Q as flag so what this will do is basically it will download ultralytics for us okay ultralytics so it will download alternatics for us which we will be using to instantiate our YOLO class so the second thing that we need to do over here is actually use the command line interface so we will say exclamation mark then we will say YOLO and then we will write detect detect predict and we are going to pass the model so here we are going to use YOLO medium YOLO V8 medium so if you go to the website or rather the GitHub page and then you go down to the detection part you can see that there are five models over here so the first one is the Nano the second one is small and the third one is medium fourth one is large and the fifth one is extra large so we are going to use the medium as you know that the model size increases as we go down that is the Nano size is the smallest and the extra large is obviously the largest but at the same time you will see that the speed of inference also increases which means that if the model size increases obviously obviously the accuracy will increase but at the same time the speed will also increase so there is basically a trade-off so what we are going to do we are going to take the middle one that is YOLO V8 m dot PT so this is going to be our model so it's a pre-trained model that we are going to use now we also need to pass in the source so we are going to say source and then you're here we are going to pass the cars.mp4 path so we are going to we have copied that and here we will just paste it and then what we are going to do we are going to do shift and enter and we will basically wait for the results to come so this has basically finished and if you go down you can see the results have been saved to runs detect predict so if you go over here and you refresh this you will see a runs folder is there so you'll open this you'll see detect then if you open this you will say predict and then at last what you are going to see is cars.mp4 but if you go and download this one from here it will not work and the reason is because this is not compressed till now so in order to make sure that we are able to view this file we have to do something over here so what we are going to do is basically we are going to compress this file so if you open this file you'll not be able to see anything so what I am going to do here is I am going to type I am going to type exclamation mark ffmpeg Dash I and then we are going to give a open close curly bracket brackets we will fill it in some time okay then what we are going to do we are going to say Dash and we are going to write V codec V codec and then lib X 264 and then we are going to give another open close bracket here we are going to give the final name of the file whatever we want so let's say I'm going to say final dot MP4 so this is the final file that we will be making now here what we are going to do here we are going to actually give the path of this file so we are going to copy the path from here and then over here we are going to give double quotation mark and paste so if I close this over here you can see the entire command is written over here now what we are going to do we are going to hit shift and enter so as you can see our code has run and you can see over here if I okay you can see the final MP4 is already there so now what you can do is you can download this file and then actually run so when you actually play this file you see that we can see the detections over here and this is how we are going to do uh video object detection using YOLO V8 so I hope you understood the video and bye
Info
Channel: Datum Learning
Views: 8,650
Rating: undefined out of 5
Keywords:
Id: Rwvd0PJF2jk
Channel Id: undefined
Length: 4min 28sec (268 seconds)
Published: Thu Jan 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.