Episode 21 | Object Detection using Ultralytics YOLOv8 Oriented Bounding Boxes (YOLOv8-OBB)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to a new video we just released a new version of YOLO V 8 we now have Yol V 8.1 for oriented bounding boxes now we can use Yol V8 just as you're using like for example detection classification post estimation segmentation and so on now we can also use it for our bounding boxes so now we can basically just fit bounding boxes around our Optics so instead of having traditional bounding boxes now they actually like be oriented and rotate together with our Optics this is very useful in a lot of different applications and projects and we're going to go over the different use cases and projects that it can used for throughout this video how we can set it up and just go through the new RN bounding box Yol 8 model so let's just jump straight into the AL ltic documentation and let's take a look at these Aran bounding boxes if you go inside the task up here at the top we can now go down and see we have this obb task as well for oriented bouny boxes we both have our detection segmentation classify and also post we have videos about all of those here in the documentation and on the allytics YouTube channel but right now we're going to focus on our bounding boxes this is pretty cool and a breakr with yolo V 8 so if you just scroll down we can see an example for ship detections so now we can see that we have these bounding boxes which is oriented so it fits the objects better and also for the cars so now our bounding boxes would act like rotate together with the car when it's taking a turn and so on so this is really useful in a lot of different applications and especially for aial images and videos so we have a bunch of different models just as for all the other task we have the Nano small medium large and extra large models here we can see the size of the images me eror position how fast it can run the optimized versions of them the number of parameters and so on so this is basically just following the whole structure for the ultra ltic documentation so we can either use a pre-end model or we can go and finetune our own or in the bounding box Yol V8 model um the one here which is pre-trained is trained on the DOTA V1 data set so this is how we can train it we just create an instance of our model and specify Yol V 8 Nano and then we just have a dash and op in instead of segmentation SE pose and so on so this is really easy to use just a few lines of code and we have everything up and running then we can just call the train we specified the the path here to our EML file the number of epoch the image size and so on but the most important thing when we're training our own models is the data set format they also have a guide for that you can just go directly in and see that so we have our class index we have our XY position XY position XY and XY which is basically just all four corners of our ored bounding boxes so this is the format that we need to have when we're not using the traditional bounding boxes so here we can also go in and see we have this tab here for our data set so oriented bounding boxes they have both do2 which is the data set that we had pre-trained the models on and also DOTA a so we can see that these are the aerial images key features data set versions and so on we can go and do validation but the most important one and we're going to see in just a second how can we run inference with this model use the pre- models out of the box with a few lines of code so we basically just take this copy paste it into a pathon script use it an own applications and projects and we have everything up and running as usual you can also go and Export the model to all these different formats so pyour Tor script onx and all those around things depending on your use case and how you want to run inference in your own projects and applications so that's pretty much it we can use the exact same way as all the other different kind of task for detection classification segmentation and so on then we can go in and copy paste this code snippet I've not copied it we can go back into our code editor paste it in first of all from allytics We need to import YOLO so we can create an instance of our YOLO V8 model for oriented bounding boxes you can also load a custom model if you just specify a path to that model but we're not going to do that in this video so now we're just going to use a pre-trend one with let's go with a small model and then the only thing that we need is basically just to throw in an image or whatever we want to throw into it into the model and we get the results out as a results generator then we can go in and extract all the results from this results variable we have a video about that and covering everything on Al litics documentation so go and check that out it is also pretty cool and how we can use it in your own projects and applications to control different things do counting and all those cool applications on top of it so now we're going to see how we can run inference right now to this model here we can just throw in an arbitrary input so it could be nonp array URL YouTube video video path even just specify the index of your camera and you can run it live on a webcam as well but right now let's just throw in this video so we have this ships. MP4 this is an example video that I'm going to show you so let just play it here this just some aerial footage from a drone basically just above and harbor we're trying to predict these ships with our in bounding boxes fitting perfectly around our Optics so this is a way better use case for our bounding boxes compared to the traditional ones so yeah let's just take the path here let's go over and copy it copy relative path let's throw it into our model here so we basically just have model so this is just the predict function we can also specified that we want to show the results so we're going to set that equal to true and we also want to save our results so there's there's a bunch of different arguments that you can throw into this model and predict function you can find all of them in the documentation so now we have everything here we can go up and create a new terminal and just run the program here and see the results so I'm just going to open up my anonda prompt activated python obbp let's now run it and see the results so now our program is actually like running we're doing inference on a video and here we can see all the predictions that we're doing on top of these um ships so this is pretty cool we get the bounding box we get the RN bounding box fitted perfectly around all those ships we don't even miss our detections we can see that we miss some here at the bottom but the rest is actually like pretty good and even though our camera or like a drone is rotating around our bounding boxes is following the exact same movement so this can be used for for a bunch of different kind of things it could be like for empty parking spaces could be for harbers here with ships moving around like empty spaces and so on but it could also be if you want to do monitoring of traffic from a Drone footage or maybe just like a top overview you want to see like how cars are turning around and so on so definitely check this one out it's only a few linage code you can get it up and running on your own computer and you're good to go if you have any cool ideas wrote them down in the comment section here or else I just hope to see you guys in the next video Until Then happy learning
Info
Channel: Ultralytics
Views: 4,775
Rating: undefined out of 5
Keywords: Object Detection, YOLOv8, Oriented Bounding Boxes, Ships Detection, Ultralytics YOLOv8-OBB, Deep Learning, Computer Vision, DOTAv1, DOTAv2, Object Tracking, OBB, Pose, Segment, Detect, Track
Id: Z7Z9pHF8wJc
Channel Id: undefined
Length: 6min 16sec (376 seconds)
Published: Wed Jan 24 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.