This project implements a face recognition system for marking student attendance.
- main.py:
- Connects to Firebase for student data.
- Captures video frames from the webcam.
- Detects faces and compares them to known encodings.
- Displays student information and updates attendance records.
- Uses multiple images for different attendance states.
- AddDataTodatabase.py:
- Adds student data (name, major, attendance) to Firebase Realtime Database.
- Uploads student images to Firebase Storage.
- EncodeGenerator.py:
- Generates a file containing encoded facial representations of students.
- Reads student images from a folder.
- Uses
face_recognitionto encode faces. - Saves encoded faces and student IDs to a pickle file (.p) for
main.py.
- OpenCV (cv2)
- face_recognition (fg)
- pickle
- numpy (np)
- cvzone (optional for text rectangles)
- firebase_admin
- Install dependencies:
pip install opencv-python face-recognition pickle numpy cvzone firebase-admin - Create a Firebase project and enable Realtime Database and Storage.
- Download the service account key file.
- Place the key file in your project directory as
serviceAccountKey.json. - Create folders named "Images" and "Resources" in your project directory.
- Add student images to "Images" and attendance state images to "Resources/Modes".
- Run
AddDataTodatabase.pyto add student data and upload images. - Run
EncodeGenerator.pyto generate the encoded faces file (EncodeFile.p). - Run
main.pyto start the application.