 Hello everyone! Welcome back to our channel. I hope you all are safe and sound. In the time of this pandemic, everything is turning contactless. Today we are going to make a touch-face security system based on face recognition technology that unlocks a door if it matches your face with one of those fed into the system. Free requisites are a laptop and a computer with latest version of picked up locks downloaded, a camera and a good internet connection. Let's begin. Click on the add extension button and choose the face detection extension. Also, we will use Toby as our assistant. Thus, we will make him speak. Click on the add extension button again and choose text to speech extension from the list. Let's first add the main element of the project, the door. We will use the door as the backdrop. Thus, click on the link in the description box to download the images. Now, go to choose a backdrop button and click on upload backdrop. Upload all the images of the door as it gives us the visual that the door is opening or closing. Wait for a little while till they are imported. Now that we have all the door images uploaded to the project, you can remove the plain backdrop. Make sure that you have selected the first costume of the door. If not, we will look for the same in the future. Now let's move Toby to the bottom left corner. Now let's add a small button to access the door. In our case, we will use ball as the button. Thus, click on the choose a sprite button and choose ball sprite from the library. You may choose the color of the ball of your choice. Also, we will place the button next to the door and reduce its size. Let's begin by writing the script to feed our face into the memory. Thus, click on Toby sprite. We will start the process of feeding the user's face into the memory on pressing the space bar. Thus, place when space key pressed block from the events palette and choose space from the drop down. Now we need Toby to instruct user to look into the camera. Thus, place a C block from the looks palette and write, please look into the camera in the space given. To make Toby say it loud, place speed block from the text to speech palette and write the same in it. Now we need to turn the camera on. Thus, from the face detection palette, place the turn on video on stage with 0% transparency block. We need the camera to analyze. Thus, add a weight block from the controls palette and write 3 in the space given. While the camera is analyzing, let's ask the user to wait for a little while. Thus, place the pair of say and speak block and write analyzing in both the spaces given. In this case, we will add the user's image as the class. Thus, place add class 1 as from camera and write the username into the space given. Next, we want Toby to assure the user that the face was stored. Thus, again use the say block and the speak block and write face stored in both the spaces. Finally, of the face is stored, we need the camera to turn off. Thus, from the face detection palette, place the turn on video on stage with 0% transparency block and choose off from the drop down. Now let's write the script for introducing Toby to the users. To execute the program every time the green flag is clicked, place a when flag click HUD block from the events palette. Now we do not need to open the camera. Thus, from the face detection palette, place the turn on video on stage with 0% transparency block and choose off from the drop down. Next, from the text to speech palette, place a sit voice to block and choose turn on from the drop down. Now to make sure that the door is closed every time green flag is clicked, we need to make it as a default backdrop. Thus, from the looks palette, place a switch backdrop to block and choose door one from the drop down. Now let's make Toby can visit. Place a say block and the speak block and write Hello, I am Toby and put the spaces. We will start the entire face recognition process for opening the door when we press the blue button. Thus, let's instruct our users the same. Duplicate the above two blocks and write, please press the blue button to access the door and put the spaces. Now let's write the script for what happens when the button is clicked. Thus, go to the ball sprite. You can rename it if you want. When this sprite is clicked, we need to broadcast the message that the user is trying to access the door. Thus, place when this sprite clicked hard block from the events palette and the broadcast block. Write access door as a new message in the drop down of the broadcast block. Now that the button is pressed, let's make the script for what happens to the door. Thus, go back to the Toby sprite. Drag and drop the broadcast message hard block and choose door access from the drop down. Let us make Toby to guide the user to look into the camera. Thus, place the say and the speak block and write, please look into the camera in both the spaces given. Now let's turn on the camera. Thus, place the turn on video on state with 0% transparency block. We need the camera to analyze. Thus, add a weight block from the controls palette and write 3 in the space given. Again, let's ask the user to wait for a little while. Replicate the pair of say and speak block and write analyzing in both the spaces given. Now to match up the face with the ones stored in the class, place the do face matching on camera block from the face detection palette. Now if the face is matched, we need Toby to say that the face matched and the door to open. Thus, place an if else block from the event's palette. Place is one class detected from the face detection palette. Now to make the Toby say the face matched and we are welcome to the house, place a pair of say and speak block and write face matched welcome to the house. You can make the Toby say your name to if you want to. Now to make the door open, place a repeat block and write 12 in the space given. Place next backdrop from the look's palette into the repeat arm. To make the backdrop change visible, place a weight of 0.1 seconds. Now what if the faces does not match? We will make Toby say that the face didn't match and ask the user to contact the owner again. Thus into the else arm, place a say and speak block and write face didn't match, please contact the owner or try again in both the spaces. Also we need to turn the camera off. Thus from the face detection palette, place a turn on video on stage with 0% transparency block and choose off from the drop down. With us, your script is ready. You can add as many faces as you want to. Please look into the camera. Analyzing. Face stored. I am Toby. Please press the blue button to access the door. Please look into the camera. Analyzing. Face matched. Welcome to the house. Take this concept a step further by implementing it in everyday life. Don't forget to share it with us in our Pixel Blocks community on Facebook. Also if you like this video, subscribe to Stimpedia and follow us on Facebook, Instagram and Twitter. Bye bye, stay safe.