AI on the Jetson Nano LESSON 37: Installing code-oss on NVIDIA Jetpack 4.3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello guys this is Palma quarter from top tech boy comm and we are here today with lesson number 37 in our incredible tutorial series where you are learning artificial intelligence on the Jetson nano I'm going to need you to pour yourself a nice big mug of iced coffee I'm going to need you to get out your Jetson nano gear and I'm gonna need you to get ready to learn some cool new stuff hey as always we want to give a shout out to you guys who are helping this channel out over on patreon your support is a huge encouragement to me and it motivates me to keep this cool material coming if you guys are not helping out yet look down in the description down below there is a link over to my patreon account think about hopping on over there and hooking a brother up but enough of this shameless self-promotion let's jump in and figure out what we're gonna do in this crazy lesson today let's see where are we back in lesson number 35 you guys were doing facial detection we're using OpenCV and some pre-canned har Cascades you could from a video camera find the faces in an image and then box them okay so we were doing face detection now what we're moving towards is doing facial recognition where you not only find the face but you say who the face is apologize for this little bit of wheeze enos we're in the midst of a corona virus pandemic and what do cleaning ladies do they pour on the Clorox and so they are split spraying bleach everywhere and the bleach makes me a little queasy rest assured I am in robust health but just while I'm sitting here breathing the noxious toxic fumes of Clorox I get a little queasy but we're gonna power on through here we're gonna get this video made okay so less than 35 we were doing face detection and then what I sort of said is is that what I found is to actually get facial recognition working that's a much much bigger bigger job and to do that we really needed to upgrade to jet pack jet pack 4.3 okay so in the last lesson we upgraded to jet pack 4.3 we got our programs moved over we did some simple configurations but what we need to do today is we need to get our Python environment on there and so what we're gonna do is we're gonna install Visual Studio code kind of like we did back in oh I don't know what was it lesson eight or nine something like that we need to do that on this side on this new fresh install we have so I will need you to come over here and go ahead and open up a terminal alright there we are and if we are going to install Visual Studio code we are going to need to first of all update our system so we will go sudo apt-get update just to make sure that we're starting out with a fresh clean ready to go system latest greatest everything fixed and ready to go that did not take long and I need to be mindful to make sure that you can see the bottom of my terminal there we go that looks pretty good ooh touch my face don't touch her face in the middle of a pandemic don't touch your face I keep remembering that that's hard you guys should just be happy I'm not wearing a mask here right okay so let's see what we what we have here so we're updated so now in order to install Visual Studio code we need a helper program in that helper program is called curl and so we are gonna go CD to our home directory shortcut to home as squiggly we are in the home directory if we LS there is a nice folder already there called downloads so we will CD down into downloads okay and that everything looks happy and so now we need to install curls so we will do sudo apt-get install curl look at that it found it looks like things are happy when when the terminal is happy everybody is happy I don't think this should take very long to install so we'll just sit here and have a little small talk at no time for small talk we have it's curled already installed so that looks good all right now we have to give that horrible monster installation and so we're gonna have a one installation command so we're gonna have a one command reprieve from my rule of no copying and pasting and we're gonna copy and paste this one so I need you to go to AI on the Jetson Nano lesson 8 ok so if you just look at this playlist this playlist that we're on or I bet you could do this let's just see if you could get a I on the jet Sun nan jet Sun Nano lesson 8 I think I have enough Google credibility just to type that in and it should find it and boom there it is lesson number 8 we will click there and go to lesson number 8 and then let me get through let me skip this so it doesn't it doesn't play that while I'm trying to teach ya look at this what is this nonsense okay so now I am on lesson number 8 and then we come down and if we look at the first comment I've got this comment pinned the link to curl install my code OSS you need to do the show more it's curl minus L curl minus L and then that github location and then this whole command here you see that whole thing is one command so I'm going to copy it I'm going to come over here and then I'm going to curl install Visual Studio code hold your breath it looks happy it's not installed yet but at least it looks happy and so we'll take a second here and get that installed you guys should be good at this we did this a long time ago like I said when we did this in lesson eight but I couldn't find any way to just upgrade the operating system the jetpack from four to two for three you just got to do kind of a clean install hey that didn't take very long and it looks like it's actually happy all right now we have to do one more command there to get it installed and I hope you can see let me make sure I might get a little further out of your way here there's one more command here that is pretty good that did not help very much but I'll just be mindful that you can see it I think maybe if I bring this you'll for sure be able to see it there and I like this view a little better all right so we are going to do sudo DP k g- i cup code under code - code - OSS underscore one point three two point three and then - a our m64 dot DB so we're gonna do a dpkg - i code OSS underscore one point three 2.3 - a RM 64 DV now if this doesn't work probably you didn't type it in right but let's go ahead and hit enter heyyyyyy looks happy looks like it found all the little things that it wanted to so we're gonna get this thing installed here we're gonna be up and running here in no time this is going incredibly smoothly and that was fast - okay I think we have code OSS installed so let's see let's see we're gonna come over here and we're gonna click this Start menu up here at the top left and then I'm gonna type code ah there it is code OSS boom we are on a roll here okay we're gonna drag and drop this into the menu because I'm gonna use this a lot so I want an icon on the menu did you see what I did there let me make sure a top 10 code I found the program and then I dragged and dropped it on to the menu now we are at the moment of truth we're gonna try to launch this Visual Studio code by clicking on it we are a one-click machine because of the work that we did last week it does look like it found it and it opened it boom we are in great shape ok you remember last week how we brought in our PI pro folder and this PI pro folder had all of those programs that we've written in the first 37 lessons with a little luck they all made it over well what we need to do is kind of make that our operating folder for Visual Studio code so we're gonna click file and we're gonna click open folder and then what do we want our working folder to be well we're gonna go to desktop and then we're gonna select PI Pro and we're gonna say ok and it looks like it's thinking now I'm gonna click on this file explorer you should know the file explorer button here I'm gonna click on the file explorer button that was already clicked and then I'm gonna look here and the good news is the folder PI pro now shows up so we've got kind of our working folder here and now all the things we do we're gonna do inside of this PI pro folder and so that should be all ready to go and so let's see that is ready so what we need to do is go ahead and get this set up for Python now and so we're going to come down to this extension manager here I think you guys can see this okay I'm gonna go ahead and make this a little bigger I'm gonna try to make it a little bigger be mindful that you can see the whole window okay and bring this up okay so what do we want to install I'm gonna click up into this search bar and what I want is Python so I'll type Python in this first one is Python lending debugging bugging multi-thread blah blah blah so I'm gonna go ahead and I'm going to install that and it's gonna take a second but it looks like everything is going along smoothly I'm intrigued by this Python 4 vs code I wonder what that is but never play around with things on the fly when you're recording videos otherwise you have to stop and start over so I have had that happen a number of different times it is still saying installing here and it makes me a little scared of whether I have an internet connection and so I'm having a little a little problem with my internet today because I don't think it should take that long ah let's see it did not install I don't think is it's still offering me install so I'm gonna like disconnect and reconnect to my network actually the Wi-Fi that I have here in my office which is a really really good one is not working today and so I am logging on to the general purpose guest 1 which doesn't seem to work quite as well so okay I'm gonna come over here and say install again on the Python and let's see it seems to like it better this time it's going I mean it loaded all of these icons down here so I I really think this is going to work and look at that this thing says uninstall so that means in fact it did get installed ok there's a couple of little bookkeeping things we need to do I'm going to come under file and I'm gonna come under preferences and I'm gonna come under color theme you can pick whatever color theme you like but I want this to be high contrast so you guys at home can see my screen really well and so I come up to the default white and that makes a nice high contrast screen for you to see the other thing I'm going to do is come into file and then I'm gonna come to preferences and settings file preferences settings and I'm gonna give you guys a bigger font so I'm going to type I'm gonna click on text editor and then I'm gonna click on font and instead of 14 I'm gonna give you a font size of about t4 and then I'm just going to click off of it so it will make sure that it has it and I think that that should that should give it to you so I'm going to go ahead and close this window here and okay let's just come back over here and let me come in to Python Pi Pro and I'm just going to open up our old hello world and yeah that should be readable to you that's a pretty nice sized font there and I think that should be B okay all right it says linter pilant is not installed failed to install MS python whoa failed to install python okay I'm gonna just say don't show again and let me close this got a little bit of an error there but let me go ahead and see if this will run and so we're gonna come here right mouse click run Python file in terminal and we got a hello world so that's good and let's see ah I know what we need to do we need to do one more thing and that is we need to hit a ctrl shift P ctrl shift P and we need to search on we need to search on select and then select Python and then you see run so that's not good let's search on select in Terp for it okay Python select interpreter can you see that so I searched on select interpreter and it came up with Python select interpreter and we want the three point six the three point six point eight we want to like that one okay now you notice that I didn't install the linter I just sort of said don't ask me about it again because what I found is the linter doesn't work very well with open CV and so any open CV command it would start giving errors on and so I just said just the heck with the linter I'm not going to use it so we ran our first program boom we have Visual Studio code up and running we ran a simple program and I'm just looking down here through our notes seeing other things that we might want to do let's see if there's a run this again I just want to make sure okay I'm gonna run it again to make sure what version we're running here okay I see the user slash bin slash Python 3 so that's good alright that is good now we're gonna need to be install again what our goal is to be able to come over here to all of these OpenCV programs that we wrote earlier it looks like we have about 23 24 programs that we wrote we want to make sure that those things will run on our new system so we want to do a couple of installs one of the things is is that it's really nice that this jetpack 4.3 comes with OpenCV ok but it doesn't come with numpy an open CV won't run without numpy so it's sort of like they gave us open CV but they didn't give us numpy so we need to go in and do some installations there and this is where you got to be really careful you can't just go and say app get install numpy or something like that we got to make sure we're using exactly the ones that are designed to run with jetpack 3 jetpack 4.3 so we're gonna we're gonna come over here and what we are going to search on is deep learning frameworks documentation is that it yeah I think that's what we want to search on so we are going to search on jetson and allied we are gonna search on Jetson Nano install deep Learning Network Jetson Nano installed deep Learning Network you're gonna click on that search now I didn't mean to sign it they're gonna search on that and I hope yeah I lost my internet connection again this is getting annoying e so I'm gonna disconnect there I'm gonna come back and I'm gonna connect again okay and then just a reminder we were searching on Jetson Nano installed deep learning framework click search and then this first one Nvidia Jetson nanos starter kit learn to build AI applications that does not look like a good one that's an ad it says nvidia deep learning framework documentation that's the one we want okay and since this was a little confusing that is not the one we want let's try installing tensorflow for jetson platform and that comes up to deep learning framework documentation that's what we want right deep learning framework documentation I hope that wasn't confusing if you got confused go back and watch it again slower but it's just hard for me to give you a long URL like that so what we want to come down here is there's some things that we want to do and we need to get numpy and we need to get pip installed so I'm going to come back to my terminal I might have to open another one I kind of lost my terminal okay so let's start by doing another update make sure that we are all up to date even though we did this just a second ago in case something cool came along in the last few minutes right mouse click paste sudo apt-get update that should go really fast okay then we will go ahead and start getting our new command I'm gonna see if I can make this larger so you guys can see it better I think that's better okay so we did the you know we're installing on number two we're installing the prerequisites and dependencies and so we did an update and now what we are going to do is we're gonna put some of these libraries and here's sudo apt-get install and it's just a set of tools that will be useful as we move forward right mouse click copy come back to our terminal right mouse click paste and enter it looks like everything's going in do you want to continue yes I do and it's getting that installed and so these are just things that are used generally for deep learning I'm not sure why they didn't just go ahead and put them on the jet pack but they make it easy enough to install and the next thing that we are going to want to do is these next few commands is we're waiting I'll go ahead and show you oh my goodness this kick me off the network again let's see disconnect this is getting to be annoying okay let's try this again okay I think it's going this time I'm sorry this like I say this is a day that our IT guy is not in and so when things like this happen we just have to suffer through it plus of course if he was here the first thing you would do is yell at me that somehow it is my fault that all this is happening but I think that we're gonna be able to just suffer our way through so we're gonna install those libraries and then the next thing that we will do is we will install Pip and then we'll set up we'll install some setup tools and then we'll install numpy and like I say you kind of want to follow along with me on this so you end up with the same number that works really well with the with a version of OpenCV that we have so kind of kind of important to stick with the roadmap here that I'm giving you hopefully this won't take very long again I don't like to stop and start and stop and start I'd rather if you got to sit there I'll sit here and we'll just chitchat all this thing is going I think this is the last one I think that we are seconds away the nice thing is we're not seeing a lot of we're not seeing a bunch of ugly stuff right so now we want to install pip for Python 3 so we will get this command under number 3 install and upgrade pip 3 copy come over here paste sudo apt-get install Python 3 - pip yes I want to install it I wouldn't have asked you if I didn't want to install it ok and I think we have been kicked off again man this is annoying we'll get through this disconnect connect okay up to get that last camp command back and it's gonna work this time yes okay it's gonna work this time after this what we're going to do is we are going to upgrade tip 3 to include test resources and setup tools okay hopefully you guys are following along what my goal is by the end of this lesson we're not going to do anything radically new but that just we have those old programs from the earlier lessons working and if we get those old programs working then in the next lesson what we're going to be doing is we're going to be configuring our system to actually do the facial recognition there's some installations we'll have to do and maybe maybe by the end of lesson number 38 we will do our first like really really simple face recognition where we recognize a person from a program that we write from scratch I [Music] just if I remember right none of these things took more than a minute or two I'm gonna go ahead and copy this next command so it'll be ready to go pseudo pip 3 and spot install - you pip test resources and setup tools right mouse click copy it looks like it was happy on that last one so I'm gonna paste pseudo pip 3 install - you pip test resources and setup tools and if this hasn't cooked kicked me off the network again okay this is that thing that this the way this is set up if you do a sudo it kind of gives you this warning message but usually it doesn't really matter usually it works okay we got that it just took a second so where we are now let's see we are going through these we just did the pseudo pip3 install - you test resources and setup tools now we're gonna do the install Python package dependencies very carefully copying just what we need and nothing else and this will give us the version of numpy that will work with everything correctly make sure you go all the way to the end right mouse click copy and then I'm going to come over here right mouse click paste and then click enter and it's a complaining again but again this has been a problem for some time that just the way the jet pack is configured you get that you get that error but I've never I've never had it turn out to be a problem and we will let it let it go there hopefully since you guys are not having the Wi-Fi problem that I am having today this will go a lot a lot smoother for you you can see that we are putting in numpy one point sixteen point one okay and there it goes okay guys that did install I was have kind of having two problems one was that the Wi-Fi kept kicking me off in the middle of the download and then the second was has just wasn't being patient enough one thing I did having trouble with the Wi-Fi I just plugged an ethernet cable in that solved that problem and then I just had to be patient it took about thirty minutes for that last step so if it seems to hang in the middle like on one of those steps just be patient sit back pour yourself some iced coffee and let it go but you can see that it did successfully install all those again that step that I had just done that step that we were working on was this step over on our deep learning framework documentation and it was this pseudo pip3 install - you numpy equal equal one point sixteen point one and then on across and so now we should have the major things that we need and so let's go in and see if this is going to look like it's going to work so we're going to come to our terminal we're gonna say python 3 and now we should be able to import cv 2 so I'm going to say import cv 2 boom we got it now let's see what version we had remember we were working on three point three point one earlier so we will say C v2 dot underscore underscore version underscore underscore boom four point one point one so we have a more advanced version of OpenCV which is going to allow us to do the face recognition so man we've made some real progress been a little bit painful just for fun I'm going to say import see the import numpy important numpy yeah you can't see that anymore can you what happened somehow I got into some crazy full-screen mode here leave fullscreen please okay so I import numpy and then I say numpy numpy with an N numpy dot dot dot underscore underscore version underscore underscore one point sixteen point one we've got the stuff that we need we should be able to run the programs that we want to run one more little thing I'm going to ctrl D to get out of Python remember in those programs where we're running the servos we've got to install the servo library let's go ahead and do that to get that out of the way so I am going to say sudo pip3 wipe it three because I want to install it with Python three so we will use pip three and then installed and then we want add fruit add a fruit - circuit circuit python - servo kit sudo pip3 and salt I guess I if I made that on one line it might make it easier for you to see okay sudo pip 3 install at a fruit - circuit python - servo kit hold your breath Oh what is wrong with you you aggravating thing it's one of those strange things it's not airing out but it is not doing anything let's see what happens there maybe we should give it a second sometimes I'm just a little bit too impatient and oh okay that's good remember it doesn't it's that tip 3 error that we're all always getting it is trying to download it that's a good sign the good news is this is the last thing that we're going to have to install this has been a little bit of a tedious lesson but it's really getting us it's really getting us queued up to do the the fun stuff with the face recognition I will say that next week the lesson will actually install the face recognition libraries and then what we'll do is well probably next week do our first actual face recognition where you'll train it on a face and then it can recognize that face and so that will be kind of exciting it looks like maybe part of what I have going on here is is that my network is really slow but we're just going to be patient and we're gonna let this let this go ahead and go through while that's downloading I'm going to go ahead and open up visual studio code again and take a look at that let's see okay looks like that's going okay we've already pretty much got this set up and I'm gonna just try to see if I can run a couple of these programs that don't need that library and so let's I want to get that bike and see it underneath okay so let's come on over here and we need to go ahead and open up open folder and we want to open pipe row and say okay I thought I already done that but maybe we need to go ahead and do that again all right and now I'm just gonna look at some of these programs my hello world program this is just a very simple program for saying hello world just want to make sure that that is running okay run please input a number all right it wants me to input a number I'll say four okay it looks like Python is running let's come down to OpenCV and let's look at some of these programs like the first OpenCV program OpenCV one you guys should have this if you've been following through it looks like this is just a very simple open the camera type of thing let's see if that's gonna work run Python file in terminal let's see if we can open the camera okay look at that hey and that was the webcam that came on so that's good news webcam is working let's come on down to like number ten OpenCV number ten we run Python file in terminal okay look at that the bouncing color box remember I don't remember what lesson that was but that's working so it looks like OpenCV is working now I will tell you the one problem you're going to have is on those programs where we were doing the contouring remember when we were searching like on a certain specific color we were trying to track on a color and we created a contour okay the contour command is different in OpenCV for point whatever where we just saw that we were on alright at 4.1.1 and i want to show you how to fix your programs and i'm not going to do it on all of them but I'll show you one time and then on those programs where you're doing a contour you can go in and fix it and let's see let's see what this one does number thirteen OpenCV number thirteen and let's see if this has a contour command in it this looks like it's track bars I'm not seeing a contour in there Oh number eighteen contours okay so this is a program which is going to try to track a pin and it has the contour command and so then I'm going to say run Python file in terminal and this is the error that you get it says underscore contours in line sixty three okay so remember when we gave a contour command we put spots for three parameters an underscore a common comic contours and then an underscore we were grabbing three parameters from the Fond contours command okay in in this new OpenCV 4.1.1 it only wants two parameters so you're gonna air out if you try to catch three so we're just going to take that first underscore grabbing a parameter in the comma and take that out and now we just have contours that's the first parameter comma underscore that's the second parameter and this thing should work now okay boom you see that and that is working let's see if we can grab the pin here let's see what color that pin would be I'm gonna set this like this and then let's see if we can get the blue in here okay so you see this is remember this was where it was tracking my eyes in a in a goofy sort of way okay it's tracking my eyes in a goofy sort of way but it is finding that blue because when you look at the when you look at this mask you can see the Blues okay you can see that for all the code that we wrote the one command that I think you're going to have to edit to get your old programs to work are the CD to define contours does that make sense okay enough of that nonsense let's quit out of here and look at this we now have installed we have now successfully installed that out of fruit circuit python servo kit library and so now our programs that we're running our servos those should work now and so I'm going to go ahead and kill this terminal and I'm going to come over here to build I think probably the last program that we wrote before we started doing these upgrades was open CV 23 face pan tilt so that's where the camera was tracking the face with the servos so I just want to see if my servos are working on this new sets system so I'm going to say run Python file in terminal and remember it takes a wobbler load that servo library and so we're gonna see what this does okay boom look at that okay it's finding my face and as I move the camera is moving to track my face boom alright so I think that was about lesson 25 that we had done that in yeah so what is this that I've kind of done in the last few minutes that's sort of confusing I wanted to make sure that in lesson number one through whatever it was 35 or 34 all those programs that we had written that they work now that we're on Chet 4.3 and what I've shown is if you change that one command in the programs where you're using CV to define contours if you change that by taking out that leading underscore in comma and if you remember to do the installations that I just did all your old program should work tedious lesson I apologize but we are now ready to go in and do facial recognition okay you guys let me know are you losing patience with me don't lose patience right because you've been wanting to do facial recognition we're almost there in the next lesson we're gonna install the last few libraries to do that and then we'll probably do just a quick demo to show how it works all right Palma quarter from top tech boy comm I will talk to you guys
Info
Channel: Paul McWhorter
Views: 8,548
Rating: undefined out of 5
Keywords:
Id: ZcmgUY6j_bI
Channel Id: undefined
Length: 42min 43sec (2563 seconds)
Published: Wed Apr 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.