This project specification outlines the design and development of a face recognition attendance system using Python 3.12 with libraries OpenCV, Face_Recognition and Tkinter.
The system aims to automate attendance tracking through real-time face detection, recognition of pre-enrolled faces, and logging attendance records. Key functionalities include robust face detection algorithms and machine learning models for accurate recognition, integrated with a user-friendly interface for system management and reporting.
The project encompasses detailed requirements, technical specifications, and an implementation plan structured around milestones and timelines. Testing and validation procedures ensure compliance with performance metrics and user acceptance criteria. Security measures address data encryption and privacy concerns following regulatory standards.
- Maintains Student Records: Stores student details and images.
- Take Attendance using Face Recognition: Uses face recognition for taking attendance.
- User Friendly UI: Ease to use and straight forward UI.
To run this project, you will need to install the following:
Python 3.12 with libraries
Download Python 3.12 from here.
libraries Used | Version | Description |
---|---|---|
Tkinter | N/A | Create graphical user interfaces. |
Pillow | 10.2 | Manipulate and edit images. |
NumPy | 1.26.4 | Efficient numerical computation and data analysis. |
OpenCV | 4.10.0.84 | Captures images using OpenCV. |
Face Recognition | 1.2.3 | Detects and recognizes faces. |
MySQL Connector | 9.0.0 | Stores data in a MySQL database. |
Pickle | N/A | Serializes data using Pickle for efficient storage. |
CSV | N/A | Exports data to CSV files for further analysis. |
Note :- Face Recognition library depends on NumPy 1.26.4, which is not forward compatible with newer NumPy versions.
MySQL 8.0 Community Edition
Download MySQL 8.0 from here.
Install all libraries in you virtual environment for avoiding any conflicts with already install libraries or installing any libraries in future. How to setup virtual environment in python 3.12.
After creating and activating virtual environment, run command below:
Command to install to Pillow
pip install pillow==10.2
Command to install to NumPy
pip install numpy==1.26.4
Command to install to OpenCV
pip install opencv-python==4.10.0.84
Note :- When installing the Face Recognition library, some users may encounter issues building the wheel for the Dlib dependency. so I added compiled binary (.whl) for Python 3.12 on a Windows x64 OS.
Command to install to dlib wheel
python -m pip install dlib-19.24.99-cp312-cp312-win_amd64.whl
Command to install to face_recognition
pip install face_recognition==1.2.3
Command to install to MySQL Connector
pip install mysql.connector-python==9.0.0
Note :- Tkinter, CSV, and Pickle are built-in Python libraries, no pip installation required.
Before running the project, follow these steps to set up the database and configure the project settings.
Open the MySQL command line and enter your password to initiate the session.
Create a new database to store student details:
CREATE DATABASE < Database Name >;
USE < Database Name >;
Create a table to store student details:
CREATE TABLE `student` (
`Department` VARCHAR(45) NOT NULL,
`Course` VARCHAR(45) NULL DEFAULT NULL,
`Year` VARCHAR(45) NULL DEFAULT NULL,
`Semester` VARCHAR(45) NULL DEFAULT NULL,
`StudentName` VARCHAR(45) NOT NULL,
`EnrollmentNumber` VARCHAR(15) NOT NULL,
`StudentDivision` VARCHAR(45) NULL DEFAULT NULL,
`Gender` VARCHAR(10) NULL DEFAULT NULL,
`StudentEMail` VARCHAR(80) NULL DEFAULT NULL,
`StudentPhone` VARCHAR(15) NULL DEFAULT NULL,
`Address` VARCHAR(250) NULL DEFAULT NULL,
`PhotoSample` VARCHAR(45) NOT NULL,
PRIMARY KEY (`EnrollmentNumber`));
Open student.py
file and update the following variables with your system's database settings:
self.mysql_host
: Your MySQL host addressself.mysql_username
: Your MySQL usernameself.mysql_pass
: Your MySQL passwordself.mysql_DB
: Your MySQL database nameself.mysql_port
: Your MySQL port number (default is usually 3306)
Make sure to replace the existing values with your own database credentials to establish a successful connection.
Pull requests are welcome.
For major changes, please open an issue first to discuss what you'd like to change.