FaceIn is a web application which utilizes facial recognition to mark the attendance, time-in, and time-out of users. It has been built as the solution to Microsoft Engage Challenge 2022.
- Features
- Tech Stack / Dependencies
- Architecture
- Agile Development Methodolgy
- Getting Started/ Setup
- Passwords
- User Guide
- Challenges Faced and Learnings
- Limitations and Scope
- Bug Reporting
- Feature Request
- Actionable and simple UI.
- Signing In using basic username/password method, provided by organization to the user.
- Ability to mark real time attendance.
- Send instant email whenever the attendance is marked in/out.
- Show attendance analytics to the user.
- Show attendance anaytics of the organization to the admin.
- Accuracy of the model is more than 99%.
- Django default admin panel also customized, in accordance with the website design.
- Automatic disappearing of notification messages like "You are now logged in", exactly after 4 seconds.
- Update user profile option, provided in the admin-dashboard.
- Contact form provided to raise any type of query that anyone may have.
- Instant email notification to admin whenever someone fills the contact form.
- Use of PostgreSQL Database.
- Completely Responsive Website.
- Add more features...
Python : The complete project is written in python programming language.
OpenCV : OpenCV and imutils have been used for image processing.
Django : Open-source python based web framework that uses MVT architectural pattern, is used.
PostgreSQL : Open-source relational database management system used in this project
VIsual Studio Code : Editor used in the project
I followed Agile Development Methodology to complete the project. Agile is an easy to handle and flexible development process which relies on light(short-termed) planning procedures. It allows faster adjustments and reviewing with an aim of keeping the principle of zero bug bounce. The complete task has been completed in 4 sprints, as depicted in the images below:
- Clone this repository.
git clone https://github.com/ansh25saini/FaceIn.git
- Make and activate the virtual environment env
python -m venv env
env/Scripts/activate
- Before installing requirements.txt, install cmake because without dlib cannot be installed and there will be a error, so,
pip install cmake==3.22.4
- After that install dlib==19.24.0
pip install dlib==19.24.0
- After installing dlib and cmake, install rest,
pip install -r requirements.txt
- Do the following command one by one
python manage.py makemigrations
python manage.py migrate
- go to env/Lib/site-packages/imutils/face_utils/facealigner.py file and change the syntax of eyesCenter (in my file it is in 64th line)
- from this
eyesCenter = ((leftEyeCenter[0] + rightEyeCenter[0]) // 2,
(leftEyeCenter[1] + rightEyeCenter[1]) // 2)
- to this
eyesCenter = (int((leftEyeCenter[0] + rightEyeCenter[0]) // 2),
int((leftEyeCenter[1] + rightEyeCenter[1]) // 2)
Make sure you follow correct indentation (of 2 spaces, as original one) while changing the above syntax; and finally save the file;
Without the int keyword, can't parse 'center'. Sequence item with index 0 has a wrong type, error will be shown while taking images.
- Finally to run the project,
python manage.py runserver
-
Admin
- username- admin@facein
- password- facein123
- email-id- ansh25saini@gmail.com
-
User-1
- username- e01
- password- e01
-
User-2
- username- e02
- password- e02
-
Website Gmail Account
- email- noreplyfacein@gmail.com
- password- facein123
-
PostgreSQL account-
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'facein_db', 'USER': 'postgres', 'PASSWORD': 'ansh123', 'HOST': 'localhost', } }
This is the home page, the nav bar area contains About, Services, Contact, Login section.
All links on every page are completely working.
Tells about what FaceIn is, its customers and their valuable reviews.
Shows our services as well as contain a demo video on how to use FaceIn.
To raise any type of query. An instant mail is sent to admin when-ever someone fills this form.
This message gets popped up whenever someone fills the form, similar message also pops up when someone log-in , mark the attendance etc. It automatically disppears after 4 seconds.
This is the mail, admin gets from faceIn Website when somebody inquires about something. Similar mail in case of marking-in/out.
Common for both user and admin. Only admin can register any user and the user has to enter that same id, password to login.
Three functionalities are present- Mark-in/Mark-out/Analytics
- Mark-in/Mark-out-
- To check the email functionality, enter your correct email address to get the email notification from noreplyfacein@gmail.com
- To mark the attendance, only one correct user can be identified at a time with correct login credentials; if frame conatins more than one user at a time whose faces can be recognized then an unauthorized message will be shown. So to mark, enter correct username of yours and only you should be in the frame.
- Press p after you think that you have been correctly recognized by the system
- Video feed will not close until you press p.
- New Registration: Provided with register, add images and train dataset, button.
- For Training option:
- Training happens of all the users in one go.
- Be patient and don't refresh in between.
- After complete training, a new window will automatically pop up showing the results.
- For Add Image option:
- Images have to be captured in real environment so as to tackle the effect of brightness on recognition.
- 30 images are captured in one go and stored in the database.
- Other features: The admin can also see the attendance analytics of the whole organization, update user profile and is also provided with a demo video to clear all doubts.
The default django-administartion has been customized according to the website style. Morever, features, reviews, current customers are dynamic and can be changed through this panel.
To go to admin panel, use /admin in the web address.
As you can see all details are properly present in an organized way, same is the case with other information as well
The website is completely responsive.
- Spent several hours learning the MVT architecture of Django and Face Recognition Models and then began the design-build process of this project.
- Never implemented any ML model in a web application, so learnt about the same and implemenetd it.
- Came across a major fault in design:- presence of the register button on the home page. I realized that in this way any user, outside the organizaton can register, so changed the design.
- Found a major error that app was recognizing and marking attendance of anybody (if the user was already registered) that was in the frame, even if the credentials were of different user. Changed the python code, so that only user whose has logged in can be marked.
- Learnt about PostgreSQL Database
- Limitations
- Face recognition accuracy severly gets affected by brightness.- To counter this, many images of the individual are added in one go in real environment conditions and not just a single image, but certainly then also brightness has a role to play.
- Training a dataset of a large number of users takes a very long time. Though training isn't something that needs to be done frequently, it would be better if a classifier taking less time while maintaining the accuracy can be built.
- In this project 30 images of each employee are taken for better accuracy. 30 Images per employee in a larger organization can consume a massive volume to store the images.
- Scope
- The training time can be reduced by retraining the classifier only for the newly added images.
- A feature can be added where an employee is automatically sent a warning if his attendance or working hours are below the threshold.
- Downloading attendance as csv file can be implemented.
Feel free to open an issue on GitHub if you find bugs.
- Feel free to open an issue on GitHub to add any additional features you feel could enhance this project.
- You can also discuss and provide suggestions to me on LinkedIn.
if (youEnjoyed) {
β starThisRepository();
}