Skip to content

YuHengKit/FaceRecognitionAttendanceSystem

Repository files navigation

Face Recognition Attendance System

alt homepage

Team HKL

Members :

1. HAU ZHE XUAN

2. KIT YU HENG

3. LIM JUN SHIUN

Overview

A face recognition based attendance system with Raspberry Pi. (Note: At least Raspberry Pi 3 to run smoothly.)

Funtions of the system:

  • Photos Management
  • User Management
  • Recognizer Training
  • Email Notification for Latecomers (Using yagmail library)
  • Attendance Record

System Architecture

Domain Model

Entity-Relationship Diagram

Class Diagram

Database Table

Normalized Table

Initial Sketching of System

Recognition Module

__init__.py contains the face_cascade object, a common resource used in face detection.

trainer.py is responsible of feeding the dataset to different models for training.

  1. Three models are available but unused: LBPH, FisherFace and EigenFace. The recognizer will compares three results from each model and get the most frequenct result.

  2. The system was upgraded with model using face_recognition library to recognize the face. Only One input image of each user is needed for training purpose. The algorithm of this recognizer is Histogram of Gradient (HOG).

recognizer.py uses pretrained models to make predictions.

capture.py adds photos to user profile.

The Django Web Interface

  • Login Page

  • Homepage: showing last stats of the system

  • Add user: to add new user

  • Capture page: to take faces photos from a local or remote device

  • Train page: to train models
  • Attendance page: shows attendance records

  • A RESTful API interface to send image and attendance records (from the raspberry pi in the prototype device)

Environment

Python: > 3.6

Install libraries: pip3 install -r requirements.txt

Running / Way to Execute

Please create photos , temp and profile folder in static folder. Please install postgreSQL and change the details in setting.py. Initialize the database from django:

  • python3 manage.py makemigrations
  • python3 manage.py migrate
  • python3 manage.py createsuperuser

Start the server: python3 manage.py runserver

Register email: open a python script in server and run import yagmail yagmail.register('mygmailusername', 'mygmailpassword') Please change the email address in emailalert() that can be found in views.py

Reset database: python manage.py flush