This repository contains code for a face recognition system implemented using Python and various libraries such as OpenCV, face_recognition, cvzone, firebase_admin, and dotenv.
To run this project locally, follow these steps:
-
Clone the repository to your local machine using the following command:
git clone https://github.com/ahmad0303/face-recognition-system.git
-
Navigate to the project directory:
cd face-recognition-system
-
Install the required Python packages using pip:
pip install -r requirements.txt
-
Set up the Firebase credentials and environment variables:
- Create a Firebase project and download the service account key (
serviceAccountKey.json
). - Set the
databaseURL
andstorageBucket
environment variables in a.env
file.databaseURL=your_database_url storageBucket=your_storage_bucket
- Create a Firebase project and download the service account key (
-
Run the main Python script:
python main.py
This face recognition system performs the following tasks:
-
Face Detection: It captures frames from the webcam and detects faces using the
face_recognition
library. -
Face Recognition: It compares the detected faces with pre-encoded faces stored in
EncodeFile.p
to recognize known faces. -
Firebase Integration: It integrates with Firebase to fetch student information and update check-in details.
-
Mode Switching: The system switches between different modes (e.g., normal mode, student information mode) based on face detection and recognition results.
face_recognition_system.py
: The main Python script that implements the face recognition system.EncodeFile.p
: Pickle file containing pre-encoded face data.serviceAccountKey.json
: Firebase service account key for authentication.Resources/
: Directory containing background images and mode images used in the system.