Skip to content

zain18jan2000/Face-Recognition-based-Attendance-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Face-Recognition-based-Attendance-System

A real time implementation of Attendance System in python.

Pre-requisites

To understand the implentation of Facial recognition based Attendance System you must have,
– Basic understanding of Image Classification
– Knowledge of Python and Deep Learning

Dependencies

1- OpenCV
2- dlib
3- face_recognition
4- os
5- imutils
6- numpy
7- pickle
8- datetime
9- Pandas

Note: To install dlib and face_recognition, you need to create a virtual environment in your IDE first.

Overview

Face is the crucial part of the human body that uniquely identifies a person. Using the face characteristics the face recognition projects can be implemented. The technique which I have used to implent this project is Deep Metric Learning.

What is Deep Metric Learning ?

If you have any prior experience with deep learning you know that we typically train a network to:
Accept a single input image
And output a classification/label for that image
However, deep metric learning is different. Instead, of trying to output a single label, we are outputting a real-valued feature vector. This technique can be divided into three steps,

Face Detection

The first task that we perform is detecting faces in the image(photograph) or video stream. Now we know that the exact coordinates or location of the face, so we extract this face for further processing.

Feature Extraction

Now see we have cropped out the face from the image, so we extract specific features from it. Here we are going to see how to use face embeddings to extract these features of the face. Here a neural network takes an image of the face of the person as input and outputs a vector that represents the most important features of a face. For the dlib facial recognition network which I have used here, the output feature vector is 128-d (i.e., a list of 128 real-valued numbers) that is used to quantify the face. This output feature vector is also called face embeddings.

Comparing Faces

We have face embeddings for each face in our data saved in a file, the next step is to recognize a new image that is not in our data. Hence the first step is to compute the face embedding for the image using the same network we used earlier and then compare this embedding with the rest of the embeddings that we have. We recognize the face if the generated embedding is closer or similar to any other embedding.

What's include in this repository ?

Three files only. These are
1- Feature_extractor.py for extracting and saving the features from images (128-d vector for each face) of persons provided
2- attendace.py for real time implementation of Face-Recognition-based-Attendance-System.
3- README.md which you are reading.

How to implement ?

Create a folder named 'images' at the same location where you have kept the python files mentioned above. In this folder you will create sub folders, each having the images of the one person whom you want the program to recognize. Each folder should have 3-4 images. Change the names of subfolder to the names of the people to be identified. Now first run Feature_extractor.py. This will takes some time and provide you a file named face_enc containing the features extracted from the the images. This file will be used by attendace.py. Now run attendace.py for real time implementation of Face-Recognition-based-Attendance-System. If a person recognized by the program then his/her name and time of recognization will be stored in record.csv . You don't need to create this file, program will itself create this file and will keep maintaining the attendance data in it.
To further understand the working of program, just go through the code files and read the comments in it.

About

An implementation of Attendance System in python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages