A web-based face attendance system that uses the webcam to capture a real-time image, recognizes faces using pre-saved encodings, and logs attendance with timestamps into a CSV file.
- Real-time webcam capture via browser
- Face recognition using
face_recognitionlibrary - Attendance logging to every records of the recognition.
- Simple Flask-based web interface
Face-Attendance-System/
├── app.py # Flask application
├── face_encodings.pkl # Pre-generated face encodings
├── Students_images/ # Folder containing student face images
├── templates/
│ └── index.html # HTML interface
├── generate_encodings.py # Script to generate face_encodings.pkl
└── README.md # Project documentation
-
Training Phase:
- Face images (named as
name_#.jpg) are stored inStudents_image/. face_encodings.pklis generated using a script that extracts encodings and saves them.
- Face images (named as
-
Recognition Phase:
- User captures an image from webcam on the web interface.
- Image is sent to the Flask server.
- Server detects faces, matches with known encodings.
- If matched, the name and timestamp are logged in
csvfile.
git clone https://github.com/itz-Mayank/AI_Attendance_Management.git
cd AI_Attendance_ManagementMake sure you have Python 3.7+ and pip installed.
pip install flask face_recognition opencv-python joblibPlace your labeled images in the Students_images/ folder. Then run:
python generate_encodings.pyThis will generate face_encodings.pkl.
python app.pyOpen http://127.0.0.1:5000 in your browser.
Attendance will be saved in csv file as a record like :
Name,Timestamp
john,2025-04-20 10:05:32
mary,2025-04-20 10:06:45
The interface includes:
- Live webcam stream
- "Capture & Recognize" button
- Result display with recognized names
- Python
- Flask
- OpenCV
- face_recognition
- HTML5 / JavaScript
- Add daily duplicate check for attendance
- Admin dashboard to view attendance logs
- Notification system for late or absent entries
- Face registration via web interface
Feel free to fork this repo, submit issues or PRs. All contributions are welcome!
MIT License