Object tracking using YOLOv9 and ByteTrack | Ultralytics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is arohi and welcome to my channel so guys in my today's video I'll show you how to perform object tracking using YOLO v9 algorithm and bite tracker so first we will detect the objects using YOLO v9 which is a object detection algorithm and after that we will send those detections to the tracker to track those objects in the next frames so guys in my previous videos of YOLO v9 whenever we want to use the YOLO v9 algorithm what we did we first clone the GitHub rapper of YOLO v9 and then we install all the requirements right this is how we use YOLO v9 algorithm but in my today's video we will use a different way to install the YOLO v9 algorithm so ultral litics they recently you know integrated this YOLO v9 algorithm in their ultral litics package so today we will use the YOLO v9 algorithm through that ultral ltic package so that means we there is no need to clone the GitHub repo of YOLO v9 we will simply write pip install ultral litics and our environment will be ready to run the YOLO v9 algorithm and the B tracker so uh let's start today's code so this is a Jupiter notebook so guys this is how you install ultral litic and after that we are importing Yolo from ultral litic and here we are loading the YOLO v9 pre-train weights there is no need to download this pre-trained weight manually so when you'll execute this cell you will automatically get this YOLO v9 c. PT uh weight file in your current working directory earlier in my previous videos we have to manually download these pre-train files but now there is no need so using this YOLO v9 pre-train model we want to perform detections and this is the video 14. MP4 this is the path of that video and on this video we want to perform predictions and save true will Simply Save your results in runs folder let's execute this Cell results are stored in predict 5 and it isn't detect and then in runs folder let's open this folder and see the result so here is the runs folder and this is the Jupiter notebook which I'm using and see this is the weight file which get downloaded when I executed this cell okay so when I executed this cell what happened first this weight file we get this weight file in our current working directory and then from this test videos I tested on this video and uh we get this runs folder inside that in predict five let's see the output so here here you can see that we are detecting all the objects which are there in Coco data set right so this is how detection works now we will perform the tracking and I'll show you the out output of tracking on the same video to perform the tracking you just need to change this one uh thing earlier we used model. detect because we want to perform the object detection but now we want to perform the tracking so for that we are just writing model. track and provide the link of the video and this is the model uh which we want to use for detection YOLO v9 will detect the object and then we will track those objects using this and the uh further frames okay so this is the same video save true will save the output and then let's run this code and results are stored in track two folder now let's go to the track two folder runs detect track 2 and let's open it here you'll see that for each detected object we have a ID here we have different different idas for different objects so this is how you can perform tracking using YOLO v9 and by trck tracker here with the help of allytics we perform detection and tracking very easily otherwise if you want to use the traditional way let's say uh if we want to detect and track the objects without using this tics package then how we will do it first we will clone the giab repo of YOLO v9 will install the requirement of that and then if after that you will see that which tracking algorithm you want to use let's say you want to use by tracker only then you will clone the GitHub rapper off by track also and then you'll install the requirement of the that b track uh tracker after that you will make some modification to use these two algorithms together but here we can do it easily with the help of ultral ltic so guys this is how you can perform object tracking using latest YOLO v9 and by tracker till now we have learned how to use pre-trained YOLO v9 model and then how to perform detection and tracking using it now guys I'll show you how to train YOLO v9 on custom data set so first let me show you the data set which I'm using this is the data set so we will detect uh fire and smoke class and you can download this data set from roof flow and just click on this YOLO V8 and then click on this download zip file and click on continue you will get a zip folder in the downloads um folder of your PC and then from there you can use it let me mention the link of this data set here so this is the data set link you can download this data set from here we have two classes in it and here we have defined the data. yl file so data. yml file is very important because this is the file which tells your algorithm about your data set and I want to trade my model for 100 epox and now let's see this data. yml file so here is my data. yml file let's open it here we have given the path of training images this is the path of validation images and this is the path of test images number of classes are two and these are the name of those classes fire and smoke now let me show you the data set so my data set is here so the jupyter notebook which I'm showing you is here data. yml file is here and this is the custom dat data set when you'll open you will get these three folders under train you have images and labels and labels are in text format because this is how YOLO for YOLO model accepts data right so for validation also you have images and label and for test data also you have images and labels and you can get this data set from the link which I've shown you from here okay so I've mentioned the link here you get it from here so when you'll run this training will start and your model will be trained for 100 EPO and after training in your runs folder let's open the runs folder here train two okay so this is the folder which have the um trained model inside this weights folder we have a best. PT and last. PT using this best. PT we can make predictions on unseen data okay and here you can see the confusion Matrix and the map values now let's test the model okay so we have trained the model custom model now let's test that model so we are loading the pre-trend model and here we are providing the video on which we want to perform testing and then let's run it let's see the output detect predict six and this five let's open it see now our model is able to detect fire and smoke so I've just rained this model for 100s okay so guys this is how you can uh work with yolo v9 through ultral litic package and I hope this video is helpful thank you for watching
Info
Channel: Code With Aarohi
Views: 1,723
Rating: undefined out of 5
Keywords: yolov9, yolo, yolov8, ultralytics, computervision, objectdetection, objecttracking
Id: ojfuuDfoqj8
Channel Id: undefined
Length: 8min 18sec (498 seconds)
Published: Thu Mar 07 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.