This is a simple face detection application. It is a part of a complete employee management system. This application is used to detect the face of the employee and store the face data in the database. The server will be used to store the face data and the client will be used to detect the face of the employee. The server is built with Flask and the client is built with Python and OpenCV.
Here Android Client Source Code repository: Employee Face Search Android
-
Clone the repository
git clone https://github.com/fsfaysalcse/FaceUnlockFlask.git
-
Create a virtual environment
python -m venv venv
-
Activate the virtual environment
# For Windows venv\Scripts\activate # For Linux source venv/bin/activate ## For Mac source venv/bin/activate
-
Install the required packages
pip install -r requirements.txt
-
Install XAMPP for MySQL Database
# Download XAMPP from the following link https://www.apachefriends.org/download.html # Install XAMPP # Start Apache and MySQL
-
Configure Database
# Open the app.py file and change the database configuration # Change the database configuration app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://username:password@localhost/db_name'
-
Run the server
python app.py
Congratulations! You have successfully installed the server.
Add Employee Data by sending a POST request to the server. You can use the following command to send a POST request to the server. The server will store the employee data in the database.
curl --location 'http://127.0.0.1:9090/upload' \
--form 'name="Mohammad Kaif"' \
--form 'email="kaif@gmail.com"' \
--form 'photo=@"/Users/fsfaysalcse/Desktop/Screenshot at Feb 13 7-39-20 AM.png"'
Detect Employee Face by sending a POST request to the server. You can use the following command to send a POST request to the server. The server will detect the employee face and return the employee data.
curl --location 'http://127.0.0.1:9090/search' \
--form 'photo=@"/Users/fsfaysalcse/Downloads/WhatsApp Image 2024-02-08 at 5.15.28 PM (1).jpeg"'
Note: You can use the client application to detect the employee face. The client application is built with Python and OpenCV. You can find the client Android application in the following repository. Android Client Repository: Employee Face Search Android
Ask Me Anything , I'm here to help you :) →