AI For Everyone LESSON 1: Introduction to Artificial Intelligence for Absolute Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is paul mcquarter from toptechboy.com and we're here today with episode number one in our incredible new tutorial series where i am going to teach you artificial intelligence what i'm going to need you to do is pour yourself a nice strong cup of iced coffee that is straight up black coffee poured over ice no sugar no sweetener none needed now as you're getting out your coffee as always i want to give a shout out to you guys that are helping me out over at patreon it is your support and your encouragement that keeps this great content coming you guys that are not helping out yet think about looking 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 let's talk about what we are going to learn i'm going to teach you artificial intelligence this is going to be an entire class it is going to be a series of lessons and in today's lessons i'm going to give you an introduction to the overall class so we're not going to be actually coding today but i'm going to be telling you what you will learn if you take this class so first of all if we if i'm going to teach you about artificial intelligence what is artificial intelligence now i could give you the computer science definition or the mit phd type of definition but instead i'm just going to give you kind of a common sense definition and the common sense definition to me is when the computer starts doing things that you would normally associate with a person doing okay so traditionally if you had something like a picture and the picture had cats and dogs in it you could hand that picture to a three-year-old and the three-year-old could draw a circle around the cats okay a two-year-old a three-year-old could draw a circle around the cats that is something that is very easy and comes very naturally to a person but that is not something that comes easy or natural to a computer typically a computer executes a very logical set of instructions and like x equal 3 y equal 2 z equal x plus y and then print z a very logical set of instructions and the computer can work it perfectly and the computer can work it quickly but the computer can't think on its own very well and so it is not going to know the difference between cats and dogs and so as we can get a computer to start doing something like look at a picture and know the difference between the cat and the dogs that is what we call artificial intelligence okay let me give you another example let's say that if i get on the computer and i open up microsoft word and i start typing and it takes those keystrokes and turns them into letters and words and paragraphs that's what you would expect a computer to do does it really well but it doesn't have to really think it doesn't have to figure things out now on the other hand if i speak into the microphone and the computer hears the sounds and then turns them into words turns them into text all of a sudden that starts being a little bit more like artificial intelligence or if we go one step further and it's not only turning those sounds into a string of letters but it's starting to discern what it is that you're saying then that really starts being artificial intelligence and so if i say what is the temperature in albuquerque and it turns that into text w h a t space i s space turns it into text that's kind of showing a little bit of intelligence but if i say what is the temperature in albuquerque and it not only turns that into a string of letters or a string of words but then perceives that you are asking it a question and then it goes out and it figures out where to look it up and it comes back and says the temperature in albuquerque new mexico this morning is 78 degrees now that starts being artificial intelligence so so that is what i consider artificial intelligence when the computer starts doing things that you would normally associate with a person when it starts doing things that are very natural for a person to do and very unnatural for a computer to do that's when i say the computer is starting to demonstrate artificial intelligence okay now if you're going to take this class what are the prerequisites okay the prerequisites really are you don't have to be an expert in programming you don't have to be an expert in computers but you do need to sort of have a little programming experience for example if you followed along with me through the python series of lessons you're good to go man you're really ready you're right on track to to do this and to find this this series of uh this series of lessons in class is very easy if you've taken my arduino lessons you're going to be pretty much ready to go in this class if you've taken the arduino it might be helpful if you had a little familiarity with python maybe you took a few of the python lessons then as i'm jumping in and doing things in python you're going to be ready for it but don't really assume i'm not assuming that you are a computer expert so what do i assume as i am making these lessons for this class i'm assuming that you're a hard worker i'm assuming that you're willing to try i'm assuming that you are willing to listen i do not assume that you already have your phd from mit in computer science i do not assume that you know the hundred magic words of artificial intelligence right i'm assuming that you're a smart guy willing to learn but that you don't already know all that stuff and man i wanted to learn artificial intelligence and i can't tell you how hard it was it is like a secret priesthood and this priesthood has a hundred words and any time they define one of those hundred magic artificial intelligence words they always use one of the other hundred words to define it and so you're just going in circles with all these things that you don't understand about tensorflow and cafe models and and uh uh deep neural networks and deep learning and machine learning and all these different things and they always define those things in terms of other things that you've never heard about so it's really hard to find like okay i'm a programmer i know a little bit about computers i know a little bit about python and arduino how do i break into this field of artificial intelligence that's what this class is going to do there's a lot of people that know a lot more than i do about artificial intelligence but i know how to teach and the things that i know i can show you how to do and we're going to have some fun along the way okay i promise i'm not going to leave anyone behind i promise that i am not going to leave anyone behind okay this class is going to be based on a windows pc i'm going to be running windows 10 and why do i do that because i've done some artificial intelligence lessons in the past on linux and on some jets and nanos and things like that and most people didn't have the board or most people didn't have the system and so this is going to be artificial intelligence for everyone because almost everyone has a pc okay if you guys have a a if you guys have a mac you can probably follow along but you're going to end up in places that you've just got to figure things out because i'm not making i can't make this series of lessons for you know all things to all people so what do i say most people have a pc and so i am going to be teaching this on the pc second thing you're going to need besides a pc you're going to need a webcam i would suggest that your life is going to be much easier and my life is going to be easier if we are running the same webcam i have a logitech webcam i have a link down in the description below if you get the same webcam that i have you can be assured that when i give code to interact with the webcam you're not going to run into problems because so many times i see comments in my videos well while i have this blah blah blah blah how do i make it work well i can't i can't solve that problem for you right i've got like 240 000 subscribers and i can't figure out every possible combination of hardware so if you get the hardware that i have this logitech look in the description down below and a windows pc running on uh windows 10 we're going to be on the same system and then we can focus on me teaching you artificial intelligence rather than us trying to figure out why your webcam isn't working does that make sense okay i hope it does now what approach am i going to be taking on this i'm going to be taking an approach where basically uh you know you're going to understand it and it's going to be fun because i'm going to start with we are going to be running on python and why python because python is one of the most popular computer programming languages i've already taught an entire series of classes on python and so python is something that most people are familiar with and if you're not familiar with it it's very easy to pick up now one of the frustrations i had another frustration i had as i was learning artificial intelligence i felt like a lot of these platforms are trying to push you into their proprietary frameworks and they're you're not really so much learning artificial intelligence as you're learning their framework and then by the time you learn the framework it's already changed and stuff and so i found it sort of a frustrating experience so i'm going to be using very mainstream programming language language which is python and then very mainstream libraries and the library that i'm going to be using with python is opencv why opencv because it's open source it's free i'll show you in a future lesson how to download and install it and then i'll show you how to use that and then you're learning something that is a standard as opposed to learning uh you know like a proprietary system with nvidia or a proprietary system with google or something like that i'm going to be sort of showing you a very mainstream way to do this stuff so it's going to be python based it's going to be pc based the library that's going to be doing the heavy lifting for us is going to be opencv okay now what i'm going to teach you then is i'm going to teach you how to use pre-trained models in opencv now i know a lot of people are saying no we want to develop we want to develop the deep neural network from scratch teach us tensorflow teach us how to do that stuff okay if i started all the way back to starting with a blank sheet of paper and training a deep neural network from scratch which i could show you how to do it would take us like 50 lessons and we would be to the point that we would have the digits 0 through 9 and then it could look at digits 0 through 9 and it could recognize it now that is an interesting intellectual exercise and maybe someday i will teach you how to do that but the problem is it's just so much abstract learning before you actually get it to do anything or do anything interesting i think by about lesson three there would be four of you that would be still in the class so i want to get us to the point that we're doing really cool and fun stuff as fast as possible now it is going to take us a couple of lessons that i show you how to install the libraries and i show you how to install the packages so be just be patient because i want to take you through that step by step so you have an artificial intelligence computation platform on your computer that matches mine and then we're really going to fly and we're going to have a lot of fun but i do need to take a little time to get you guys to get these packages installed and that'll be the first couple of lessons i'll show you how to do that but what i'll show you then is i'll show you within opencv how we can load pre-trained models and then we can get them to do really cool and really fun stuff and then what we can do is we can take those pre-trained models and we can retrain them for things that we're interested in so maybe there is a pre-trained bottle out there that can tell the difference between cats and dogs but we retrain that model to tell the difference between a raspberry pine art and an arduino okay but you see i can do that by retraining an existing model as opposed to trying to train a model from scratch now you got to understand some of these libraries out there they have trained these things based on millions and millions of images and hundreds of thousands of hours on these really huge parallel processors and we just we don't have the time or we don't have the money or we don't have the resources to train these things ourselves but we don't need to we'll go grab one of those free ones that's already been done the heavy work done and then we'll tweak it and we'll retrain it for what we want if we wanted to train something from scratch man it would take an incredible amount of computation power and an incredible amount of image processing and taking pictures and processing things and it just turns out to be not that much fun so we're not going to try to reinvent the wheel we're going to be using as a starting point models that already exist okay then what the really fun thing is remember excuse me in our lessons in our python lessons what have i taught you already you guys that have been with me a while i've taught you arduino arduino is really fun to work with things in the real world like it gets data from sensors and then it sends commands to like actuators servos stepper motors so you know leds relays and so there's all these things the arduino can get data from and then there's all these things that arduino can make happen in the real world and that's a lot of fun but the arduino is very simple you'd never be able to do artificial intelligence on it but in python in those python lessons what we did is we learned python which is very powerful runs on your pc now we're working to get python to work with the arduino and now in this series of lessons what i'm going to do is i'm going to show you how to do artificial intelligence and then what my vision is it's going to be really really fun because python is going to be doing artificial intelligence and it's going to be sending commands and data and information back and forth with arduino and then arduino is interacting with the real world and so arduino is getting data from the world it's sending it to python python is doing artificial intelligence and then sending commands back to arduino and so all the sudden this real magic is going to happen and maybe i'll kind of give you an example here of what i am talking about but but our system is going to in the end be interacting with the real world it's going to be getting information getting data from the real world processing it with artificial intelligence and then affecting things like making actuators move making servos move based on the artificial intelligence and so let me give you let me give you some quick examples again i'm sorry that we're not coding to get day i know you guys love to jump in and code but i just felt like it was important for me to set the context for this class and for me to let you know what you're getting into and let you know whether this class would really be right for you or not so what i'm going to do is i'm going to switch over here and i am going to show you sort of like one of the first things that we are going to be learning here like this would be kind of like the simplest this would be kind of like the simplest uh opencv program right i said python so this is a python interpreter and then i said we're going to be using the opencv library and i just want to show you just how simple some of this stuff is going to be the first thing this program does make sure that you can see it let me see if i can ah that that didn't work that was an unexpected result there it is okay hopefully you can see this a little bit better so this is a python program i import opencv i then create a camera object that i called my cam and then i have a loop here and what do i do in the loop well i read from my camera object i read from my camera object a frame now i have one picture then what do i do i then show that picture with the cv2 dot im show and so i read a frame i show a frame read a frame show a frame read frame show frame if i keep doing that i have a what i have a movie i have a video so what this program does is it goes and grabs frames and shows frames and then i have a way to gracefully exit that if the program sees the letter q pressed then it is going to quit and then it's going to release the camera back to be available for someone else so if we run this program it is 10 lines of code it's under 10 lines of code actually and boom look at that read read a frame show a frame okay now why is it a little bit glitchy it's a little bit glitchy because i am running wirecast to do this video recording and that is really really really putting a huge load on my graphics card and on my computation this will run much smoother and much faster for you if you're not trying to live stream and do real-time video processing using using wirecast so the reason it's a tad bit glitchy is because i have a huge monster load on my cpu and on my graphics card running this uh this video processing software so that you can have this lesson but i digress okay so now remember if i click q it makes it go away so now was there anything artificial intelligent about that no but it is kind of cool that with under 10 lines of code we can make our own little webcam program now this is where the artificial intelligence comes in you see that i read the frame i read the frame here from the camera and then here i show the frame so i read a frame show a frame read a frame show a frame now what i can do is i can come into this program between the read frame in the show frame and this is where the magic happens this is where the mischief happens now i want you to think like you can run a video real time is like 30 frames a second and so how much time do you have between read and show you have like a 30th of a second and for a modern graphics card and for a modern computer that's like infinite time it's like you you have all the time in the universe between the read frame and the show frame to do all of these really really incredible things and that is where the magic happens that's where the artificial intelligence happens so let's do a little bit more complicated program now instead of just importing cv2 in this particular example i'm going to be showing you lots of different libraries and lots of different programs i'm just hap happening to use a library called media pipe which are some pre-trained artificial intelligence programs and then what i am doing now is where was my loop okay i still read the frame and i still show the frame but between read and show what i am going to do is i am going to run a process called face detect and so it takes that image and it processes that image to find the faces and then it gives you a result and then if any faces were found then what it is going to do it is going to do some drawing on those faces okay so still i'm like under 25 lines of code and what i can do there is boom what did i tell it to do i told it to find and analyze the face now it drew a box around the face and then also look it is saying not only i have a face not only the face is here but look i'm going to look at that face and i see two eyes i see a nose i see a mouth and i see two ears so all of a sudden i've got xy position of nose eyes mouth ears blocks in the faces so you see now all of a sudden this is kind of starting to be artificial intelligence and that was just a few lines of code to let me do that now imagine that based on that i could start sending commands down to arduino to do certain things based on what you are seeing in the uh in the picture i could do more sophisticated things between still we are this is more lines of code you can see but still between the read the image here and the show the image here i'm now doing some more sophisticated analysis and let's see where did it go okay here you can see that i'm not only detecting a face i'm kind of trying finding facial landmarks and then look at this i'm also finding the hands okay so i'm finding hands and face now this point here the tip of the finger there i have an x y coordinate for the tip of that finger i have an x y coordinate for the eye so i know how far my finger is from my eye i've taken this complex picture and i've reduced it down to math and so now all of a sudden we could do something like say if my fingers started getting too close to my eye beep warning me hey don't touch your face you know we got the virus thing going on out there don't touch your face you see see all of a sudden you could start interacting with the world based on artificial intelligence okay let's do a couple more quick demos here let's see what this one does okay here what you can see i'm doing is i can superimpose that analysis back on top of the original image which is kind of cool and then i can come in here and give you another quick demo okay and here rather than analyzing the face i'm analyzing the whole body okay and if i stood up and danced for you you know it would show my hips and my knees and my feet but i will i'll spare you that that embarrassment okay but you see i've got the shoulders i've got kind of the hands it doesn't have all 10 fingers but kind of sees the position of the hands the elbows the shoulders if i showed up it would sort of give you all of my major joints and the amazing thing is i'm getting x y coordinates for all of those so i know where they are and so that would allow me to write programs that would understand what a person is doing you know starting to do things like with gestures have things happen based on what my hand gestures are based on what my body motion is start having the arduino do things based on that okay let's do one more here you can analyze not just not just things like not just things like faces and people but you could look for other things like a coffee cup and you can see this coffee cup is a little hard for it to find but you can see that it is finding and tracking and orienting in three-dimensional space my coffee cup the coffee cup is a pre-trained model but we could take that pre-trained model and we could retrain it and we could retrain it instead of looking for a coffee cup we could retrain it to look at a monkey i am having monkey problems these days though yep okay i know you guys hate it when i digress but i i can't help it okay so so i have monkeys that are stealing my food all right and so i was asking so i said man what happened to this stuff they said well the monkeys the the monkeys took the corn okay the monkeys took the corn and i said well how about the dogs were the dogs they said the monkeys were sitting on the porch eating your corn and i said well how come the dogs how come the dogs didn't chase the monkeys off and what they told me was they said well the monkeys were feeding the dogs okay so the dogs have sided with the monkeys because the monkeys are feeding them but i digress just you think of the worst pests you've ever had and the monkey has a large cerebral cortex and the monkey has thumbs and so the monkey is really smart he has thumbs that means he is a formidable opponent and i have problems with monkeys eating my food getting in my garden and stuff and so i'm thinking about rather than recognizing a coffee cup what if i could recognize a monkey and then take counter measures we'll just leave it at that okay so anyway i apologize that i have digressed like that but in this in this uh in in these classes okay in these classes there are going to be homework okay and so every lesson i'm going to give you a homework and then usually the next lesson i'll come back and give you the solution to the homework so hopefully you can figure it out but if you can't figure it out then in the next lesson i'll do it but guys i need you to really try to do the homework before you just go and copy what i've done because when you try and when you fail and when you struggle and figure it out then it's like the greatest joy ever to struggle with a hard problem and then figure it out okay and then even if you don't figure it out then when you see me do it it's like the light bulb will go off ah i see where i was getting stuck and i see how i should have thought about it and now i see how to do it now if you don't do it on your own and you just fold up like a cheap lawn chair and can't do it and then when you see me do it and then you understand it what you need to do then is you need to pause the video and then you need to go back and do it on your own without watching me so you you figured out from watching me how to do it but you still need to go back and do it on your own without watching me and then you would will have really learned because the goal of this class is not for you to just copy what i do and impress your friends by copying and pasting what i do but my goal is for you to go out and be able to do what i can do without me now i like you following along with me but i want you to be able to do these things without me and that's what my goal is so there will be homework and then the following lesson i'll show you the solution to the homework so maybe i'll try to do if i can i'll try to do like two lessons a week in one lesson i'll teach you something and give you homework and in the next lesson i'll give you the solution and then the next lesson i'll teach you something and give you an assignment and then the next lesson i'll give you the solution okay so maybe we'll try to do two two lessons a week and then always always learning something new but since i didn't really teach you too much today i will because i am going to give you homework the other thing i'm going to do is i'm really going to try to incorporate math into this because darn it most people hate math and they hate it for good reason and the reason people hate math is number one their math teacher in school probably didn't really understand math math teachers are showing you a series of steps and then you're trying to memorize those steps and you're trying to be able to repeat back these steps you don't understand why the steps are important and you don't understand what the steps mean but you're just trying to get through math and you hate math but really the beautiful thing about math is there's problems and you can't there's important problems important things you want to do in a project you can't really do them unless you understand the math so i'm really going to be trying to incorporate math and physics into this as well in a fun way okay so that some of these things are going to require you to to kind of know some math and then i'll also be teaching you that math so we're going to be doing a little artificial intelligence we're going to be doing a little physics we're going to be doing a little math but we're going to be having fun as we do it okay and so that's kind of what you can expect in this class whole lot of fun but you're going to be learning some important stuff but you really need to be trying to do the homework that i give you but for today what the homework assignment for today is i told you a little bit about artificial intelligence well i need you to write a paragraph in the comments down below or at least a bulleted list but maybe a paragraph where you've actually thought about this what do you think are the three biggest potential benefits to mankind that artificial intelligence might have like ways that you could use it to that could fundamentally improve mankind and then the second thing i want you to do is tell me what you think the the three biggest risks or the three biggest threats of artificial intelligence are okay the three biggest advantages of artificial intelligence how it could impact positively mankind the three biggest risks the way that it could threaten mankind and then leave a paragraph down below or at least a bulleted list of the three uh you know good things the three threats that artificial intelligence have and then the conclusion about overall do you think that net net it's worth it or net net we should just hope it goes away and run from it so let's get your perspective and then the second assignment is read the other comments down below and respond back to someone so you guys that are taking this class start and get to know each other and start having a little dialogue and maybe i will jump in every once in a while okay guys i hope you hope you're willing to take this class i am really looking forward to it and i've got some exciting things planned and uh if you like this video give me a thumbs up leave a comment down below like you're you're a crazy old man and there's no way i'm going to do this or this sounds interesting i think i might do it and again i i hope you guys would be maybe following along on my python lessons as well okay guys this is paul mcquarter from toptechboy.com i will talk to you guys [Music] later
Info
Channel: Paul McWhorter
Views: 29,316
Rating: undefined out of 5
Keywords: Python, AI, Intellligence, Programming
Id: gD_HWj_hvbo
Channel Id: undefined
Length: 31min 29sec (1889 seconds)
Published: Thu Jul 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.