Face Recognition | Hackademy _ | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

6 Lessons (37m)
    • 1. Introduction

    • 2. 1) Service and technologies

    • 3. 2) Plugin deployment

    • 4. 3) API deployment

    • 5. 4) Review how the API works

    • 6. 5) Review on how the web Interface works

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Implement your own custom face recognition solution. 
With this course you will see how to configure your own API to recognise several profile pictures in one group photo. 

Meet Your Teacher

Teacher Profile Image

Hackademy _

Visit us at http://hackademy.ydns.eu


In the true sense of the word hacking is about exploring, understand how things work and we can change them in order to make them operate as we want too.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Introduction: this course, Euler out to build your own face recognition Web interface and a P I Web service. He will do up on interface like this one. Where you gonna blow several user profiles and then we'll group photos to detect who is on the photo. We will see how this is then with JavaScript. Also some html for the front end, and then we'll see how the a p I slumping part and works. You can download the source code in the depth to your needs. 2. 1) Service and technologies: we have seen several techniques regarding that organization and implementation approaches. However, I want this course three. Practical. Therefore, in this chapter, we'll do some coding, so I'll start by introducing what the service ISS. It's space on any A P. I drop it in Parton that gets two kinds off files. It gets them user profile teachers, and then we upload the group photos. Okay, so the idea you your is that system can detect who he's on the group photo, so I'll start by making a quick test. You can access his website. It's available online. First reconnection WP dot com But you will need to work in with your Google account over year. Okay, because thes uses ah aws service and it is seven limit. That's resource is okay, so I cannot just allow for everybody to just simply use the surface, because, if so, the resources will be all expanding in quite OK, so this is probably what you'll get, But it's a quick connection with Facebook or Google. If you want to test his service right here on the website. Okay, it's not no problem. I'll show you anyway how it works. So ah, disease Let's say it's the public version off the service. As you can see, you have the user profiles over here, then the group photo. I already have some photos uploaded. Okay, disease for the sig arose band and also one member off Green Day. So, um, I'll start by a blood in the profile photos just files on a desktop Green day. You can love download this tree pictures on the assets. Okay, just make it easier. So I noticed that this one's already loaded. So I love this one. A good file and you can see it's loaded automatically refreshes the list. No one more to go, then I think we should be good. Okay. Awesome. And now I will blow the group photo good. And I'll click a bold file. It does take some more time because it's processing the data. That's why we don't get such a fast response. Like we get over here that if everything is arrived, you will see that to the the profiles will be. And they are indeed in it to fight. Okay. As you can see, the system manage to detect who is on the photo just based on the profiles photos that we did a blood. Okay. And it's gonna be very convenient. Now, imagine that. You have, for example, ah, that you have an academy gymnasium and you need to check who came to the class. So if you have the students profile pictures, you simply need to take a photo at, you know, off the glass, upload the photo little tell you right the way who is on the class so you don't need to heart. Guess. There's also some more features that people can use this. Okay, I don't believe it's kind of a practical and the interesting approach. So you can also get more information right over here on this website. And if you want to test a plug in and you have enrolled on one off my courses, you could just send me a message. And also in the Blufgan free off charge is to you. Okay, so this is just some wearing info is also this video showing you out the how it works. Okay, so just what we have seen, as you can see, just to really practical blogging. And now I'll show you how life coated this Blufgan, and I'll show you out to implement your own version and private face recognition server 3. 2) Plugin deployment: as we have seen, this technology was floor but for WordPress or a generally and you have treat options here so you can never work Press website running locally and say, Like for a docker container or local WP that's available at local the Beat Local the loop. Eat that calm and this might be the first phosphor option and it's the one that I used to develop them that the two locally. Okay, so it's really easy to get going. Just download and you'll have the site running in no time. I can show you over years, but this is just were breast local flopping tool just okay as it conceals really easy to get going. Okay, But I can start to set and also you should already have some war prince website online that you want to use. You can also use it like a remote website. And do you also have the option to check on the service right here on these website? It's the website. First recognition that would be that Come dash 10 box. When you first front to loving on the website, it will ask you for a password. Good. So however, justice password is academy just like them? The name off the chance off this you channel. Okay. As you can see, just type academy and you will be good to toe logging on the test. The sandbox. Okay, so let's create a new local website. The goal here is just to have a WORDPRESS website reading our plucking. I already had a website running, so I will not create a new one. However, probably you will need to. Okay. So you can pause the feud you right now, and create a new website. When you are done, probably you will have something like this, that it could be different then to access the admin. Bad coffees. You'll need to click right here on admin. Okay, some I'm already over there. And now the goal here is to install our plugging. Okay, so you can done with the plugging from the assets off his last time, and then you'll just go to plug ins at new And over here you left the option toe, upload the flooding, and you will choose them planting file to work blood. Okay, so this is the men ified version off the plug in, and it does not check if the user is logged ing, meaning that it's a good idea to protect them. That page. Okay, so I'm not just not making it available for everyone. Okay, You can also use WordPress plug ins. To do it is Okay, so after you have the bloody stalled and run running, you will have to get the pages. And I created a new base they'll need to create the new page created his local Dell will be I'll click on it and then inside the page, you have this short code, okay? And disease, what will fetch the plaguing interface and we'll show on them under page that we want that . Could you just need to call these shortcuts? Okay. So, for instance, if you want to create, this is a custom HTML you click your on the blows and good to custom html and just simply insert the shortcut. OK? I'll just remove this. And when you are done that, bro, you will need to click Publish over here. Okay. You'll go to the opera. Few. If everything is all right, you'll see that he got something right over here. Okay, so for now, you might get the nearer our will not show the delighted because it's it's not computer to connect to the server. Okay, because we are just going to set yet ap I server on the next lesson, and we're when we are done doing that, we will connect our plugging to the FBI server in our to upload the user, profiles, photos, the group photos and be able to do the the Mitch. 4. 3) API deployment: the FBI deployment wouldn't be as straightforward as they were breast blood in. Okay, so we need to install somewhere libraries and F. Parton tree reading. Okay, so first, let's start with Parton. It was just a veneer council. Okay? And as you can see, I have the latest Fortunoff. Parton can also be useful to where previous Beytin versions. Okay, So, Patton, it's something that you need to install. And the installation will be different according to the operating system that he used. I mean, Mac, it was quite quite easy to install it. Okay, so, um, nevertheless, we are reducing the tree. The version tree off, partner. Okay, so that's the latest for the time being. Denton off. Um, after Patten. Honestly, my suggestion is that you can check out his webpage. It is Is the A p I that we are using, see, available right here at his key trip a story. And they have the quite the guidelines to his talk. Okay. As you can see, real running. We already have Parton. I'm using neck and out. We will also install thes the library over on lean Exxon Mobil. It okay, Tibet for windows, But I believe that you might get get around it and get it working, okay? And also need to have to live installed. And this will be different. According that if you are running, going to or Mac os honestly, over here on Mac OS, I'd definitely troubles installing it. And after five minutes, I had the FBI running after u F D is we left. You will have to install the first recognition FBI by using Petri. Okay, so hopefully everything is okay. And you got titties told and now you can download the source files that are available on these lessons. Okay, so just go ahead and download them. And when you have them, you left something like this. Okay, As you can see him, I'm using part char. It's ah, it's a commercial. I d. Okay, So, nevertheless, you can use something like, if he's well, code to work just fine. Also so now important. And this script, and I'm not going to explain how it works. Okay, Well, we'll do that in the fragile essence. For now, we just wanted to have it running for our local server. Okay, So what? We are going to try spy country leather name off the script if everything goes all right. Okay? As you can see, it's running by the falter. Debate is active. Since we are developing, there's no point in making toe false and will notice off the messages that we might get just to check that is running. You can go and check on the website and that, dear refresh it. As you can see, it's working. There's game notices that try to get If I stop it, let's try and refresh. You'll see that it's down. You can if you use part charm. You can also cause you're the server right over here, okay, and you can run and restart it. Well, it's pretty much the same. Okay said, There's no, not that big difference. Okay? And now So this is for the partner version running the A P I. Probably when you do this, we'll just have to stop this one. Try again. You might guess embarrassing that you need to install library, but nevertheless, fightin is very comprehensive because it also how puts the command that you should run in order to install that library. So it really used attendance by being really useful to use because it then you just have to run. The commander leads people install a flask, for instance. Okay, so it really easy to get it working, but most likely you will not have flask installed will not have courts are installed. But either way, I'll just go in that sense of, like, a flask. Okay, so I'm not going to install it again, because already it installed. And I don't mean I don't need to override our that much the installation that I have. Okay, so now this is for the U. P. I. Also, she had any question by to get it running. Just send me a message. I'll try to you help you as best as I can. Okay? So for now, I'll just leave the FBI server reading. Hey, seems to be writing. Let's just let it be. And now for do Web, the web interface. So this isn't and I didn't default. If you don't know the files, you'll just get theirs. And this is the default address. Okay, So you should be good to go. Okay. So no big issues over a year Now, if you come back over a year to our um However, you will have to reload. So So the practice to open the consul. Okay, so just check ifs. Something is going wrong. This is related to Bootstrap. So let's not We'll fix it by now. And as he considers a consul, output with the names by default. I did uploads some photos over a year. Okay, if you happen to have no photos, it will just intel put anything, okay? And also that you like, create day, by the way. Now, okay, But you can upload the new photos over here because you just have to a bloat. That team. I just want to blow stuff for sandwich a both file and as we have seen yet just the Bloods . Fine. Okay, just the check. That disease running. Let's right. The group photo on its right over year, Green day. So now it's connecting to our local sort of look, it's not using any remote date. And as you can see, it's right here. So this means if it's working all right, and these things that you now ever local server Okay, so the zoo is will only be available to you or anyone that can access. He's this hate p I 5. 4) Review how the API works: now we will review how the hey, baby, I Parton killed Works. OK, so we'll start with the first lines. As you can see, we are using flask and flask. Allow us to have a running web service with chest a few lines off coats in Brighton. Okay, so it's really used to use. As you can see, we have it here and down the year, which is it is if I just go here down to the bottom as you continue. This is mostly just what we need to have Web service running and the page showing that this service is ready. Then we are importance, um, libraries prone flask diseases to allow the calls from my website, one other both. Now for instance, imagine that you have these website running like I do on face recognition. That will be that calm. Okay. However, these FBI service is writing for Eastern's on Emma's. That aws Okay, So what's happening? That my website, he's making a call toe another post and that's why we need is across origin function. Then we have the global variables. He also it Then we import face recognition that we are using to match and competitive faces . Okay, so disease them main function that there's most off the magic to compare the faces them, so it will receive, Ah, follow him. This Fallon will be the group photo, and over here it will search. It'll do a for loop inside the person's folder, So that's why it's important to keep the same names for the folders are. If you change the folders, the fuller limbs, at least you could do is you could also need to do a search and replace over a year on the coat. Then we are using. We start using first recognition, Functionalities said. She has the load for much file, okay, and then we are including the faces that we have on the person's Fuller's. So these works by including the faces and then by comparing them to the group, the faces that are on the group and this is the profile images. And then we get the face, the face locations on the group photo. OK, so this is where it close the group photo and it gets the first locations off the group. Then, now that we have the profile encoding and also the group, the faces on the group, including We are going to compare them. Okay, So as you can see over here, we do these for loop again. That will get the others facing coating. And then it will compare my face incurring with other spacing, coating being my face, including the ones that are on the profile on the person's folder. As for the others facing cutting, being the once the new image that is on the group photo over your U F D is variable. That's the tolerance. I found this to be the optimal value, and nevertheless you are free to change this value because if it's ah, distant crew photo, the told jurors will work best if you were, for instance, 0.5. So, as you can see, it's not quite a big differences, but in some cases it will work best if we change these tolerance value. Now, finally, over here, what we are doing is that we are just removing the path name and the foul extension because the results come with the best name that will be like Group Dash Green Day, and we will also remove that G peak extension. Okay, there's only to have it several Just remove it. And finally, this function will return at Jason. Um, format response off the date. Okay, so this is important because we are then selling these date back to the server now, then we have the first recognition service. That's the post. Okay, So disease, the core that will use thes function is to find the the profiles, as you concede, sir. Post method. Because we are also receiving a file. Okay, so this is the file. That's for the group. The image off the group that we will save. We'll also get its name, and then we will lose the above functions find face that we just define it right over here That will output that data that we are looking for you can either say, Hey, look, I found this and profiles when the group photo or I did not find anything. Okay, So disease the coal for the face rec. Okay, then we have this get group image. Okay, So when did stand? We also have these extra call to get just the image off the group that was used. Okay, so no big deal over a year, and then we also have the Gap person's image. So this is also to send the file both methods is to send the group image and disease to stand the profile. The person's pictures. OK, so this is to send the files. And then over here we have This is a default function. Get all persons images and since it is a get, you can also run these directly on the on the wirral off your website. Okay, The post are not quite like it, but they get you can just insert to get or persons village on the website. And as you can see what's just to a quick shake over a year now, let's just remove this and, as you can see, because it is a get and it just gives right back the data in the Jason format now, we'll also have this function toe upload user profile full, though, and then finally disease the default message that the user gets when he or she just tried to xsd FBI. Okay, as you might have not this we have this cross origin and this is where I talked about in the beginning. It's because you might have a service running like locally, but your server might be external, so we need to have this cross our origin toe allow calls from multiple sources. So just finished is up No, over a year on the bottom. I mean, on the main off the function of the n disease. The host when we are reading the service and it is the pork And since we are still the bagging and checking on our application works, the deeper is set to true. Nevertheless, later on, if you'll send us to production left to set and false Okay, so this is overall few off other core code works. This is a simplified version off the script. Okay, so this is meant to be practical and to work. 6. 5) Review on how the web Interface works: now we will review the code off our plugged in. So this is the project that website that we have created on local. Okay, so it's you need to open it using an I. D. Are you considering hope in the folder and check on the files? But I I use BHP Storm for projects that are related to wordpress. And until now, it works perfectly to me. Okay, so we're going to focus right here on this blood in this. What? You are working. Okay. As you can see you have, this is the main. It's like the index file the index PHP off the blooding. That's the same name off the folder. Very just a math information may not really important. And this is good practice, because if someone tries to access directly your beach be it will get an exit. Enter. Okay, so you're there's no I don't think there's any problem card. There's no direct echo, but in the more complicated PHP file, we can have some issues if we don't use that some information disclosure that we don't want to. Okay, so Well, let's start with the basics on the basics girl for the loading this. He assessed that we need Okay, so this year says he's quite simple and it's not gonna be the focus off these lessons as you can see test, um, styles all said the bootstrap because we're using the grid. And this plaguing also works in more bile and in different few pork size. And then we have the main GS folate is where most off the magic there's happened. Okay, but although there in a minute now, then we are just loading the files, OK? It's also some files and some others for the menu. And over here we are adding the menu to the back office. When you go into the back office off your WORDPRESS, you'll see that there's thes menu right over here. Okay, this is it. Uh, perfect. Now, over a year, I just had it to do this worker. I mean, I'm not saying that it's the best way to do it. Honestly, if we have a templates, they should be in separated folders. Okay. However, I just said it working this way because html is not as long as that. And then also, I couldn't everything just want one page in one template and also running to issues by using them the shortcut function that will look like to run. And these white works for me. Okay, so it doesn't mean it's the best way, but it's the way it works. When we have something working, it's better than maybe it can be better than cranked off. Just follow good practice and then the in the instep by not working. Okay, so, uh, let's go to the HTML code. Well, also, no big mystery over here. As you can see, we have this title Topas figure out where we are. Okay? Changes according the tip. And then we have these, uh, that one. Okay, this is the steps that you can silver year. Also, no big deal. And then this is the container for the group photo. OK, so this is the default container. Okay, then. As you can see, there's the loading. You were wrong, and then it will get the default image. Okay. As we'll see, just this is the default place of the older, because thes thesis search files will be replaced when we gather response from the server. So this is just loading the default images that you can also change and are over here on the assets Fuller. Okay, then we have this second user profile Stab. Also, we can see test his image loaded. Okay. And then it does, um, the loading data for weather that is being processes. Now, just here at the bottom off the file. As you can see, we have these. Ah, first recognition, a short code. Okay. And for the time being is dis checking if the user is logged in. But if you're running it locally, what we can also to this it should work. Just finally. Also, it's the return, and I think now works here. Uh, let's see. Well, culturally being Mark. I works here, so it's best with the check if the user is logged in. Mostly if we have these, the bitch can be accessed from remote users. Okay. Okay. So this is for the eight html. OK, No big deal. And then we have the main. She s okay. This is where most off the world will happen. OK, so let's review this carefully. Now, as you can see, the functions are loading when the When the the files, the other fires are loaded, okay? And then we have the wear. Oh, so this is where the a p I server is running a sour Parton ap I server that were set up right here, and it's running. If you change the baby, I too remote services to another computer. You will have to update these value. Okay, now, this is for the group photos template. We are preventing the default event from the form. Okay, so we don't Well, he's to go for the default, you thin. But on the other end, we I need to get the data in creating new XML. Http request and these will be opposed. And it will go and would call the face rec the insurgents available right here. But you're not here year. Okay, So this is where it will receive the room photo, and it will try to find for profile faces. Good. Then over here, we get the far input. We greet the firm data, we append this file to the form that's going to be sent. So over here, we that they that is send OK, but then we wait for some changes on the status. So since we got the for it because we have some return and leave whoever 200. It's because some user data Westfall Then we had we created his HTML would get the response text. That's the Jason that you can see right over here. Okay, disease to this response. You know, we create the list with the objects from the list. And finally, we will insert his results over these diff that's declared over a year on them. HTML OK, so we'll just insert injected date that that least data that we got. Finally, we will also help that the default image. Okay, this image over here off the will be the group image that the user just uploaded on the other end of something. When wrong, the user will get the message and also the coat off the message to try to find out what went wrong or it since the Dayton Now, for the user profile template, it's this'll one right here. So this is where the user sends the data. And when the user sends another datum the default list, these at least will be cleared. Okay, so we can get anyone so that that the extent as it considers for the following put gets the the file that user wants to send. This is regarding the profile, and then it will send the file. And if everything is OK if he got his return, will run the get load users fund kids that will update the users list on the other. And if something goes wrong, it will say a something went wrong. Check out the status. This is a function that loads the users, Wist says he contain grown sometimes grins right here on the beginning window far always loaded and it grands When the user sends in you profile picture into our a p. I Okay, just two in desert. This is the get loaded users. Functions well and what dysfunction does it? Well, it calls are a p I. We get get all persons image does. He might remember these first real return the files, the name off the profiles that are inside the person's for folder. So we've got it. Run tree. Then we will course the Jason because thes data country Jason, it's in the Jason four months, and if he is fit slim, he's bigger than zeros. Because we have some results. We will also create the least with did state that that we will. Then I'll put directly into the HTML. Okay, something went wrong to also say that error and also send the form data last but not the least. We have these little interaction for that tax that this detect that, Debs, that a user quickened and changes that this right over here. Okay. As you can see, it's quite a simple blood in It's not more complicated, but it's also the most simplest version off this blood, you know. OK, so this does not mean that that's what you're Levin could Canyon, for instance. However, these this work just fine, and I hope it gets to do what you are looking to.