The complete code of the above implementation is uploaded as a notebook to the AIM’s GitHub repository. This also notes down the time of arrival thus can acquire information about people coming in late after a specified time.
We’ve then used this to build a face attendance system which can be helpful in offices, schools or any other place reducing manual labour and automatically updating the attendance records in day-to-day life. OUTPUT įace recognition library being a high level deep learning library helps in identifying faces accurately. With open('Attendance_Register.csv','r+') as f: Reading from attendance file, Storing data(Name and Time of entry) if previously not stored. MatchList = fr.compare_faces(encodeKnown,encFace)įaceDist = fr.face_distance(encodeKnown,encFace)
for encodeFace,faceLoc in zip(encodesInFrame,facesInFrame): Lastly, we call the Attendance function along with the person name who is identified. Now the incoming images are tested against the previously-stored encodings. facesInFrame = fr.face_locations(image)ĮncodesInFrame = fr.face_encodings(image,facesInFrame) The same process is followed by the first detection face location then getting the face encoding values. Image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
MODNet – A Trimap & Green Screen free Solution For Real-time Portrait Matting def DbEncodings(images): pathlib = 'ImagesAttendance'įinding face encodings of images in the database and keeping them in a list to use later with incoming frames. Append the filenames into a list called Names and remove the extension. Path setting to the directory containing the image database. Only once the file will store the matched image’s details, if the same image is received again then it’ll not update. Now we are ready to build a realtime face attendance system wherein webcam captured frames will be matched against the existing database images and if the match is found then it’ll store it in a CSV file called ‘Attendance Register’ along with name and time of capture. Result = fr.compare_faces(,encTest)įaceDist = fr.face_distance(,encTest)
Test = fr.load_image_file('ian_godfellow.jpg') ImgAng = fr.load_image_file('andrew_ng.jpg') The lower the distance the better the matching and vice versa. The face distance function gets the value of that by how much the two images differ. Then a comparison between these two returned lists is done by the function compare_faces() which returns a list of boolean values(True or False). Both these two steps are followed for the original and test image.
Then face encodings(markings of eyes, nose, mouth, jaws which remain the same for different images of the same person) are taken using face_encodings() function which returns a list containing 128 measurements. The last step is to match these encoding with the nearest possible image from a stored database.įirst, we get the location of where exactly the face is in the image using face_location() method(which gets the outline of the face) on the RGB image. Source – face recognition library documentation
There are many use cases such as authentication and verification of users. Many researchers have come up with many new techniques to efficiently identify and tell apart faces. In Computer Vision face recognition has been in since ages and has evolved over the years. Ultimately what a computer recognizes is pixel values ranging from 0-255. A face recognition system is built for matching human faces with a digital image. Recognizing people by their faces in pictures and video feeds is seen everywhere starting from social media to phone cameras.