Face recognition-based attendance system with DeepFace (99%+ accuracy) or LBPH fallback. Captures faces, trains a model, and marks attendance via camera.
-
Install dependencies:
pip install -r requirements.txt
-
For higher accuracy (optional): install DeepFace + TensorFlow
pip install deepface tensorflow
- Capture Faces – Collect face samples for each student
- Train Model – Train the recognition model on the dataset
- Take Attendance – Run attendance; press Enter in the camera window to finish
python simple_gui.py- Capture Faces – Add students to the dataset
- Train Model – Train after capturing
- Start Attendance – Take attendance; press Enter to exit and generate the sheet
- Today's Report – View today's attendance report
- Folder buttons – Open dataset, trainer, records, sheets
# 1. Capture faces (interactive)
python capture_faces.py
# 2. Train the model
python train_model.py
# 3. Run attendance (press Enter to exit)
python attendance.pyattendance.py– Main attendance system (DeepFace + LBPH)capture_faces.py– Face capture (press C to capture, ESC to finish)train_model.py– LBPH model trainingsemester_register.py– Generates Excel/HTML/CSV registersimple_gui.py– GUI launcherface_alignment_utils.py– Preprocessing (CLAHE, alignment)dataset/– Student face images (Name_RollNo/folders)trainer/– Trained model (trainer.yml)attendance_records/– Daily attendance CSV/JSONattendance_sheets/– Semester register outputs
Create folders as Name_RollNo (e.g. John Doe_42). Each folder should have at least 10–30 face images.
- Python 3.8+
- Webcam
- OpenCV, pandas, numpy, openpyxl (core)
- DeepFace, TensorFlow (optional, for higher accuracy)