Object Detection with Yolov8 using Jetson Nano

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 detection using YOLO V8 on Jetson none so so uh the jetpack SDK version which I'm using is 4.6.1 now let's check the default python versions which come with this 4.6.1 okay so so this is the python now let's check the Python 3 version so these are the two python version which you get when you install Jetpack SDK 4.6.1 okay so now to run YOLO V8 you need to install the ultralytics package okay so you can just write pip install ultralytics and you will have the environment which will run your Uno V8 so I have created a separate environment uh for YOLO V8 so let's activate that environment so this is the environment okay so in this environment I want to install Ultra latex package so let's execute the command so you'll see this error okay so what this error means is that the ultralytic package is either not available on this python 3.6.9 or the operating system which we are using is that ultrolytic package is not supported with that operating system okay so now the next step is we need a different version of python to run the ultra latex okay so we will install python 3.8 now and then on that python 3.8 we will run our ultralytics package we will install the ultralytics package and then we'll run YOLO V8 on it so let's do that deactivate this environment now run these three commands one by one first okay so once you execute all these three commands now the next step is to download the source code of python 3.8 from the official website you can use this command to download that uh source code of python 3.8 directly on Jetson Nano okay once you downloaded you uh the source code of python 3.8 you need to unzip that file and then you need to enter into that python 3.8 folder okay so uh once you enter the python 3.8 folder now we'll start with the build process so uh let's configure the build process first you can configure it like this and after configuring now you need to build the python use this step to build the python and once your compilation is complete you can simply install all python using this command okay so now after executing all these steps your python is installed you can check the python version using this command and yes you can see that we have python 3.8 now Okay so now the next step is to create a separate environment guys I always recommend to work under a separate environment so that's why I'm creating a separate environment you can use these two lines to create and activate the environment so once your environment is activated now you can run now let me activate the environment first okay so my environment is my v in okay so first you need to write source remind me okay now let's check the python version after activating the environment so my python version is this okay now inside this python we will install the ultralytic package so I have already installed it I'm just showing you the command you will not get that error the error which we got out here okay now let's install ultralatics package so you can see requirement already satisfied because I have executed the steps already okay now if you want to check the ultralytics uh version just write fifth show virtualities and okay so you can see here the ultralytics package is installed and this is the version which we are using okay so now uh the next step is to run the YOLO V8 algorithm so guys for that I'm using a jupyter notebook and if you also want to run on Jupiter notebook just write pip install Jupiter notebook and you will get your Jupiter notebook installed after that just write Jupiter notebook 2 open the notebook okay so here you will get your jupyter notebook now my code is available in Python examples I'm entering in that then YOLO V8 example this is a folder in which I have my yellow V8 work so we are going there and this is the Jupiter notebook where I have the code okay let's open it so this is how you import ultralytics Library okay module so after that I am using the pre-trained model this YOLO v8n.pt okay so no need to download it externally when you will execute this command this model will be downloaded in your current working directory okay so this is the pre-trained model I'm using I'm just testing YOLO V8 using the pre-trained model okay so like this and after that just execute this command what we are doing is we are calling the model on this image I want to work save equals to true if you are writing this then only you will get the image with the detection stored in the runs folder okay so always remember if you want to store the results then you need to write this okay so let's execute it when you will execute it you will get the output and the image on which I want to work that image is available okay I haven't executed this first let me execute this and this okay so my test data is available in test folder let's open that folder and see so thin examples here is python examples and then inside it we have YOLO V8 and see you can see here on this set that predict 4 is saving the results this is a run folder inside that text folder predict for and here is the output for that particular image we are testing on so this is how you can use YOLO V8 on image and guys if you want to use it on video then you need to give the path of video like this so uh once it get executed you will see the results in detect folder only and let's see here here is a so video is stored over here so this is how you can run the code on video okay and guys after that I want to tell you one more thing that okay Hill here you can see if you check the torch version you will see that we have this torch version 2.0.1 and Cuda version is none now see the code which I have shown you that code is working on the CPU of Jetson Nano okay so we are not we were not using GPU uh for the predictions okay so if you want to use GPU for your predictions then your pie torch should be compiled with Cuda okay so in our case we just run that command pip install ultralytics and we get uh the torch and torch Vision version uh everything is there but that is not compatible with um that is not working with our GPU so for that you need to install the pytor's version manually okay so what you need to do is just manually install pytorch by uh using the that pie torch wheel right and then only you can use it and if you want to learn how to install partosh manually okay then you can check my video uh link is given in description section using that video you can download the pytorch and torch Vision um which is compiled with Cuda okay and then you can run the you know your predictions on GPU okay so that's it guys this is how you can use YOLO V8 on Jetson Nano and I hope this video is helpful so guys if you like my video please like share and subscribe my channel thank you for watching
Info
Channel: Code With Aarohi
Views: 19,133
Rating: undefined out of 5
Keywords: jetsonnano, yolov8, jetson, yolov5, objectdetection, computervision, ai, artificialintelligence
Id: pAEkHsNkul0
Channel Id: undefined
Length: 10min 8sec (608 seconds)
Published: Tue Jun 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.