This web application is designed for face recognition and verification. It allows users to perform the following actions:
-
Train a Face Model: Users can train a face recognition model by uploading images of individuals along with their names.
-
Verify a Face: Users can upload an image and verify if it matches any of the trained faces.
-
Live Streaming: Users can access live video streaming with face recognition enabled.
The project is structured as follows:
face-rec-web/
│
├── src/
│ ├── app.py # Main Flask application
│ ├── face_database.py # Face recognition and database handling
│ ├── templates/ # HTML templates
│ ├── static/ # Static assets (CSS, images, etc.)
│ ├── utils.py/ # Utilities
│
│
├── docker-compose.yml # Docker deployment configuration
├── requirements.txt # Python dependencies
└── README.md # Project documentation
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/danielAdama/face-recognition-app.git cd face-recognition-app
-
Install the required Python packages:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the project root and add the following variables:AWS_ACCESS_KEY_ID=your_aws_access_key AWS_SECRET_ACCESS_KEY=your_aws_secret_key
-
Start the Flask application:
python src/app.py
-
Access the application in your web browser at
http://localhost:8080
.
-
Navigate to the home page.
-
Enter the name of the person associated with the uploaded images.
-
Choose multiple images of the person for training (recommended to use more than 4 images).
-
Click the "Train Model" button.
-
Navigate to the verification page.
-
Upload an image for verification (only one image at a time).
-
Click the "Verify Image" button.
-
Navigate to the live streaming page.
-
Access the live video stream with face recognition enabled.
- Python
- Flask
- OpenCV
- Face Recognition Library
- AWS
- HTML/CSS
- JavaScript (SweetAlert for pop-up notifications)
- Docker
To deploy this application using Docker Compose, follow these steps:
-
Clone the repository:
git clone https://github.com/danielAdama/face-recognition-app.git cd face-recognition-app
-
Ensure you have Docker Compose installed on your system.
-
Run the Docker Compose stack:
docker-compose up --build
-
Access the application in your web browser at
http://localhost:8080
.
The web application should now be running in a Docker container.
For more details on this project, refer to the documentation in the docs directory.