 Hello everyone! Welcome back to our channel. I hope you all are safe and sound. Because of the current pandemic, everything is becoming contactless, from lift buttons, to doors, to sanitizer dispensers. So, why should the fingerprint-based attendant system widely used in offices and schools be left behind? In this video, we are going to show you how to make a contact-free, face-recognition-based attendant system using Pictoblock's AI. Our system will first take a sample image of the person whose attendance needs to be tracked. The next time when the system scans the person's face, it will match the image with the sample image stored and will note down the timestamp for that person. Pre-requisites are a laptop or a computer with a camera, latest version of Pictoblock's downloaded and a good internet connection. You can download the all-new Pictoblock's from the link given in the description box below. Let's begin by adding the face detection and the data-locker extensions. Open Pictoblock's. Now to work with the AI and ML extensions, you must sign in or login into Pictoblock's from here. Click on board and select Evive. To work with the AI and ML extensions, you need to connect your computer to the internet. Click on the face detection extension and wait for a little while till the models get loaded. Next, we need to add the data-locker extension. Thus, click on the Add extension button again and choose Data Logger. This extension lets you generate a CSV file according to your requirement and store data in it. We will first need the sample images of whose attendance we need to track. Thus, click on Choose a Backdrop button and select Upload Backdrop to upload the images. Right now, we will be using a sample image of Robert Downey Jr. and Chris Evans separately and one image of them together to test the code. Let's first recognize the image and store them in the computer's memory. Click on Choose a Sprite button and select Square Box Sprite from the library. We don't need to be sprite. Thus, right-click on it and select Delete from the menu. As soon as we press any of the keys on the keyboard, the data should be stored on the computer's memory. Thus, from the Events palette, drag and drop when space is pressed block and select I from the drop-down. To analyze the images from the Backdrop, we need the camera to be 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. Next, we will store the images of Robert and Chris into the memory. Thus, from the Looks palette, place a Switch Backdrop to block and select Robert Downey Jr. from the drop-down. Next, add a weight of 1 second from the control's palette. Now, to store the Robert Downey Jr. space, from the Detection palette, place Add Class 1 as a Stage block. Select 1 from the first drop-down and stage from the second to identify the image or backdrop as Robert Downey Jr. Write Robert Downey Jr. into the space given. Similarly, to store Chris Evans' face into the memory, duplicate the above block and make the necessary changes. Now, let's move on to the main script. To execute the program, whenever the green flag is clicked, place the when flag clicked hat block from the Events palette. We will initially hide the square box. Thus, from the Looks palette, drag and drop the height block. Next, we will create a new file to store the attendance data. Thus, from the Data Logger palette, choose a Create block and name it Attendance. Now, we will change our backdrop to a photo where we have both Robert Downey Jr. and Chris Evans together. Thus, from the Looks palette, switch the backdrop to Robert and Chris. And as we want to verify the image on the stage, we will make sure that the camera is off. Thus, we can add the turn off video block. Now, as to continuously analyze the image, add a forever block from the Controls palette. We need to match the faces on the stage. Thus, drag and drop the do-face matching on Stage block from the Face Detection palette. As we will recognize multiple faces on the stage, multiple clones of the square box sprite is created. Thus, we will broadcast a message to delete the clone of the square box. Put a broadcast message1 block. Next, we will make a separate script to delete the clone while it will run parallelly. Thus, drag and drop when I receive message1 hat block from the events palette. Place delete this clone block from the Controls palette to delete the clone of the square boxes. Now, let's continue with the main script. Next, we need to store the data of the recognized people. Thus, get an F block and check if the recognized faces are more than zero. Place a greater than operator block into the if condition. To check the number of faces, use the get number of faces block from the Face Detection palette and place it into the first input of the greater than operator. Write zero in the second. Now, let's make a variable. Click on Variable palette and then click on Make a new variable. Name it as face. Next, set the variable face to zero inside the if block. Now, we need to repeat the process of data logging for all the found faces. Thus, place a repeat until block and add an equal to operator block from the operator palette. Place the reporter block of face variable in the first input and place the get number of faces from the data extension into the second input. Now, we will increment the variable face by one each time the repeat block is executed. Thus, add a change face by one block. Now, to store the data, we will add the blocks from the data log extension. To store the timestamp first, place the set the data one to block and choose current timestamp. The get current timestamp block contains all the data and chain related information. Now, in the second data, we will store the class of the recognized face. Which contains the name of a person whose face is recognized. The data has been loaded. But to permanently save the data on the file, we need to use the save data block. Create a clone of block and choose myself from the dropdown to recognize multiple people from the stage. Finally, we will make the square box right to perfectly fit around the person's face. Thus, let's set its size and location accordingly. First, set the size of the square box by using the set size to block from the looks palette. Place get exposition of face reporter block inside it and choose width from the dropdown. Add the face reporter into the space given. Next, to move our square box to the location of the object, add go to XY block from the motion palette. Insert to exposition of face block and choose exposition and y position from the respective blocks to obtain the x value and the y value of the face respectively. Finally, to display the class of recognized face which is the name of the person, get the save for seconds block from the looks palette and make it say the class of the detected face. Now that everything is perfectly aligned, place the show block. You can try making this project with your friends and you can use the webcam to analyze your faces too. Share your projects with us in our picture blocks community on Facebook. Also, if you like this video, give it a thumbs up and subscribe to STEMpedia and follow us on Facebook, Instagram and Twitter. Bye bye, stay safe.