This is a Python application for capturing images from a camera, comparing them with a reference image, and logging the results. The system utilizes Amazon Web Services (AWS) for image storage and face recognition services.
Before using this application, please ensure you have the following prerequisites:
- Python 3.10.11 installed in a virtual environment.
- AWS CLI configured with your API keys.
Installing OpenCV using pip till take a lot of time and may be error prone. This is why it is better to install it using apt
, which installs the prebuilt wheel.
Run this command in the terminal:
sudo apt install python3-opencv
-
Clone this repository:
-
Navigate to the project directory:
-
Initialize the python virtual environment:
python -m venv venv
-
Install the required Python packages using
pip
:pip install -r requirements.txt
-
Create a
.env
file in the project directory with the following content and replace<YOUR_BUCKET_NAME>
and<YOUR_BASE_FACE_FILE>
with your AWS S3 bucket name and the base face image file:bucket_name=<YOUR_BUCKET_NAME> base_face_file=<YOUR_BASE_FACE_FILE>
Make sure you have configured AWS CLI with your credentials using the following command:
aws configure
Provide your AWS Access Key ID, Secret Access Key, region, and output format. Toggle on Bucket Versioning
on your S3 bucket.
To run the application, execute the face_auth.py
script from the project directory:
python face_auth.py
Follow the on-screen instructions to allow the application to access your camera and detect faces. The application will capture an image if a face is detected and its quality is sufficient.
- This application must be run from the project directory to correctly access the
.env
file and directories likecaptured_images
,logs
,haarcascade
etc.
This project is licensed under the MIT License - see the LICENSE file for details.