YOLO V3 – Install and run Yolo on Nvidia Jetson Nano (with GPU)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to this new video tutorial we're going to see today one of the most requested video I've had lately which is how to run Yolo on the GPU and we're going to see that today using the Nvidia Jetson Nano as you might have noticed I haven't done video for a while but it was August it was vacation time for some period and also I'm working on the video course about the Raspberry Pi and the Jets on and so I don't have much time but anyway here we are today and let's see how to run yellow on the GPU [Music] let me quickly explain first how it works to run the euro algorithm we need a framework and Yolo comes with the darknet framework so first thing right now we are going to install the darknet framework and keep in mind that we have two different darkness so it can be confusing if you just check look for dark net one is the dark net made by the founder of Yolo PI J Reddy and the other one is darkness from Alex a a B and I found this second one from Alex say to be much more compatible with different machines and it worked right away when I stole it from the Jester nano while the other one didn't work so I will just close this pi generate the dark net we will not use that one instead we are going to install dark net from Alex a a B and so let's do that right now we just open the terminal and I have the in code code to copy in this txt file so first thing we are going to update the libraries so sudo apt-get update and by the way this code that I have here on the txt file I'm going to put it on the blog so you can just check it on the link below the video so let's place this sudo apt-get update and of course me to put the password of administrator of your system and let's wait till all the updates are done and then we go with the second line second we need to export the cuda path so we have these two lines so CUDA is let's say the software to to run the GPU let's put it this way the software to run the GPU and for some reason on the Jets on nano doesn't have the default path that works with the arc net so we need to copy this one and export these two lines and press ENTER so that we are setting this path of CUDA for all the users of the Ubuntu system and once with this we can install the darknet first we need to copy the folder from git hub so with this code git clone we're going to copy the folder let's put the code right here and so we have the folder in if we check just here we should see darknet okay so what I do now is we enter in the folder darknet and by the way we see the windows bar because I'm accessing the Jetson Nano remotely from my computer so that I can record the screen that's why you see me on Windows when I use this so let's access the darknet folder so CD for change directory and then darknet and now once we're inside the darknet we need to download the weights file of the yellow algorithm so we copy first yellow 3 this one so this is the train model model of Yolo 3 this is the entire version of yellow and we're also going to download tiny Yolo which is the smaller faster version of Yolo I'm going to pause the video until this one is done okay let's know your download Yolo tiny so we copy this one and press Enter and this one is going to be fine much faster as it's much smaller you always 20:36 megabyte while this one it's around 45 close to that no even less 34 megabyte and now once we've this weekend we need to change the settings of the darknet make file before compiling it so you can other access here from the terminal so you can either do sudo we make file this one or you can just go on the darknet folder from here just you see the fat make file and you click with the right button and you open it with the vim terminal so now we need to change the settings and here we see GPS UD and and and a few other things right here and we are interested in just three of them so 0 it means it's not activated and one is to activate that function GPU of course we want to use the GPU so we're going to activate this one and we're going to put one then see you the n n it means CUDA so for the media GPU this must be activated then we are this udn and half which is written here that is going to speed up three times this but it only works with faster computing the Jets on so we don't have to activate this one and then open CV we want to compile it also for open CV so we're going to put one right here and then there are all the few functions that we are not interested about at least at the moment and with this we now press ask and then shift and then double that to save the file once the file is saved we just type make and now in this way we are going we are compiling the library it should take a couple of minutes so I'm going to pause the video well I guess it takes a bit more than a couple of minutes for up to four or five minutes anyway when we see these long lines without any error it means that installation was done correctly now it's the moment of the truth we're going just to test yellow so I'm going now to clear the windows here clear the terminal keep in mind that to us darknet we must be inside the darknet folder so if you just open the terminal from scratch let's see this way you just open the terminal you just need to type cd' darknet and now we can write the document using the code that we find on the github page how to use let's see this one and here are all the common lines to use the darknet different situation like for example just loading the video or running from the webcam I save the file with the result so now we will try with the webcam for the webcam is this one so what we need is all this line except that this is not X this is for Windows so if you see only Knox use dot slash document instead of darkness not X so we are going to copy this line I will copied it slowly so I can explain everything that it's here let's make this smaller okay so we say dot slash dark net we load detector demo and now we need to define KOCO data KOCO data is the names of the object that we are going to attack cool it contains 80 objects CFG dot data then CFG and all these files are just inside the arc net folders you don't you don't have to do anything with this then yellow version 3.0 and this is the configuration file of the trade model Yolo version 3 and then the weight file that we have downloaded before yellow route 3 dot weights and then camera with a fine C 0 which is the first camera if you have different webcams you can change the indexed one for the second so for the third and so on and now we press ENTER ok now euro has been is loading and let's wait a few seconds and we should see the camera on the screen with the detection and keep in mind that for me it's a bit slower than normal as I'm recording also the screen I am remotely with windows so it's bit smaller than usual okay first we have normal yellow correct detection person which is me and here on the left side we can see FPS frames per second and the objects detected so let's take some other objects like for example the photo the pan it's a bit slow in comparison with the other camera okay I'm going to shrink a bit my camera on the side so you can see whether the other one okay bottle is detected correctly the pan it's not knife okay then let's see the phone we have cell phone and I take a small dictionary that I have about Italian polish language toothbrush that I don't see anywhere let's see if at least both detection or anything like this and what you might have noticed is that it's really slow we are able to get only two frames per second and that's probably it is going to disappoint many of you as I was disappointing myself but you need to keep mad this is still a cheap small device Nvidia jets on nano for only $99 plus a few extra things for the case and my christy and power and so on might still achieve device and it's a good result but this is the heavy yellow this heavy yellow on the computer machine with the CPU runs even slower let's instead go and check how fast is the tiny yellow on the Jets on nano with the GPU so I close this one press ask and now let's find the one regarding tiny yellow so here you see tiny yellow and so let's copy this one it's ok let's type it I'm going to clear the rest clear dot slash darknet and then the Tector demo and CFG coco dot data so we are still going to detect the same 80 objects from the cocoa data sets and then c FG Yolo version three tiny dot C F G and then yellow version three tiny dot Waits and then also we want to again from the camera so we say C - C okay ploy without the - - C 0 and we press ENTER okay now it is going to load the tally Yolo and I'm going to try the same thing with the same objects let's again move okay let's put the terminal to the right so that we can see the informations okay almost there okay what you can notice is the frames per second which dramatically increased we're now going through around 16 frames per second which is not that bad for the GPU it's not we are time to have like a completely rough time we should have at least 25 30 frames per second but it's already realizable to use it also in some work environment if we want to detect some specific object passing somewhere it's good enough this this speed the other add the disadvantage is that 10 EUR is not as precise as Yolo and now it's not detecting anything at all let's just do some quick test with some objects I will take from pictures and let's see what we're able to get my original idea was now to take some picture from the phone show it and attacked objects but for some reason like I cannot get the text remove the autofocus from the camera so the picture is not really clear here so instead of doing it this way I have some other and even more interesting idea you can see here after webcam we can use also net video cam so what I'm going to do either you can use an IP camera or either with your smartphone this Android but also with the iPhone you can do the same you install an app called IP webcam and I also show in another video on my youtube channel out to install this app you can check about IP webcam something like that and we're going to string what we see from this camera we are going to stream it to the Jetta so now so I'm going to show out of the window and we try to detect some objects in real time so IP webcam I start the server and it is connected to the same router where the jet so nano is connected so here there is the IP written where I have to connect to receive the video stream so what you see here yet it is also an IP I'm going to put on this long code I'm going to change the IP address with my IP address from the phone so let's quickly copy this one so from the Tector 2mg PG and I'm not able to detect to copy these two lines okay then okay I already have the terminals so I go on the terminal and I type dot dot slash dark net and then I paste the code and I need to change the IP with my IP which is almost exactly the same instead of 80 it's 14 the last 80 14 and also ok and also we are going to use your log version 3 tiny not the normal because normal is too slow so instead of yellow 3 waits with a yolo'd 3 - tiny and also in the configuration file we use tiny and let's run it ok now it's loading the algorithm ok interesting everything you see here it's what is coming inside my webcam so I'm now going to open the window let's see what we can detect outside [Music] I'm not sure this was able to detect anything at all there wasn't much to the tech probably okay now we're back my station yeah it's where I'm doing the recording anyway I'm going to stop this one and so I hope you enjoyed this lesson and maybe you will might have something better to detect than what I had today and I will post some new interesting videos soon and for the moment you can set up data about the video course and all the things about the Raspberry Pi and then just so no no see you in the next video
Info
Channel: Pysource
Views: 76,019
Rating: undefined out of 5
Keywords: yolo gpu, yolo 3, darknet yolo, yolo jetson nano, install yolo, install darknet, computer vision
Id: K03WZyee6ig
Channel Id: undefined
Length: 22min 0sec (1320 seconds)
Published: Thu Aug 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.