Skip to content

FaceIn is a web application which makes use of facial recognition to mark the attendance, time-in, and time-out of users. I developed this application as a part of the Microsoft Engage Program challenge 2022.

Notifications You must be signed in to change notification settings

ansh25saini/FaceIn

Repository files navigation

logo

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.

home

πŸ”— Relevant Links

πŸ“Œ Table of Contents

πŸš€ Features

  • 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...

πŸ’» Tech Stack / Dependencies

Python Bootstrap Postgres Visual Studio Code Git Django OpenCV

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

πŸͺ’ Architecture

architecture

architecture2

⚑️ Agile Development Methodology

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:

agile-1

agile-2

πŸ“¦ Getting Started/ Setup

  1. Clone this repository.
  git clone https://github.com/ansh25saini/FaceIn.git
  1. Make and activate the virtual environment env
  python -m venv env
  env/Scripts/activate
  1. 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
  1. After that install dlib==19.24.0
 pip install dlib==19.24.0
  1. After installing dlib and cmake, install rest,
 pip install -r requirements.txt
  1. Do the following command one by one
 python manage.py makemigrations
 python manage.py migrate
  1. 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.

  1. Finally to run the project,
python manage.py runserver

πŸ”‘ Passwords

  • Admin

  • User-1

    • username- e01
    • password- e01
  • User-2

    • username- e02
    • password- e02
  • Website Gmail Account

  • PostgreSQL account-

    DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': 'facein_db',
          'USER': 'postgres',
          'PASSWORD': 'ansh123',
          'HOST': 'localhost',
      }
    }

πŸ“– User Guide

Home Page

This is the home page, the nav bar area contains About, Services, Contact, Login section.

All links on every page are completely working.

Home-2

About Page

Tells about what FaceIn is, its customers and their valuable reviews.

about-1

about-1

Services Page

Shows our services as well as contain a demo video on how to use FaceIn.

services

Contact Page

To raise any type of query. An instant mail is sent to admin when-ever someone fills this form.

contact1

contact2

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.

message

This is the mail, admin gets from faceIn Website when somebody inquires about something. Similar mail in case of marking-in/out.

mail

Login Page

Common for both user and admin. Only admin can register any user and the user has to enter that same id, password to login.

log-in

User Dashboard Page

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.

user_dashboard

mark-in

Admin Dashboard Page

  1. 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.

admin_dashboard_features

register

  1. 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.

admin_dashboard_others

admin_dashboard_others

Admin Django Panel

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.

admin_panel-2

As you can see all details are properly present in an organized way, same is the case with other information as well adminpanel2

Responsive Website

The website is completely responsive. responsive webpage

πŸ’‘ Challenges faced and learnings

  • 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 and Scope

  • 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.

πŸ› Bug Reporting

Feel free to open an issue on GitHub if you find bugs.

⭐ Feature Request

  • 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();
}

About

FaceIn is a web application which makes use of facial recognition to mark the attendance, time-in, and time-out of users. I developed this application as a part of the Microsoft Engage Program challenge 2022.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages