A simple Facial recognition Grpc Service to enroll and verify faces

Dr-Swopt d4454e9352 added updated readme 10 months ago
proto 2c432fa26a idiot 10 months ago
.gitignore d4454e9352 added updated readme 10 months ago
README.md d4454e9352 added updated readme 10 months ago
grpc_client.py 91a085ca15 further changes in face recognition 10 months ago
grpc_server.py 2c432fa26a idiot 10 months ago
requirements.txt e6df6ad535 setup 10 months ago

README.md

gRPC Face Recognition Service - Part 1

A Python gRPC server for face recognition and employee management using DeepFace.
This service enables you to enroll faces, recognize faces, list all employees, and delete employees efficiently.


Features

  • Face Recognition: Identify a person from an image and return the best match with confidence score.
  • Enroll Employees: Save new employee face images to the system.
  • List Employees: Retrieve a list of all enrolled employees along with their images.
  • Delete Employees: Remove an employee by name from the system.

Setup & Environment

1. Clone the Repository

git clone cd

2. Create a Python Virtual Environment

Windows (PowerShell or CMD): python -m venv venv

macOS / Linux: python3 -m venv venv

3. Activate the Virtual Environment

Windows (PowerShell): .\venv\Scripts\Activate.ps1

Windows (CMD): venv\Scripts\activate.bat

macOS / Linux: source venv/bin/activate

4. Install Dependencies

pip install grpcio grpcio-tools deepface pandas opencv-python

5. Generate gRPC Python Files (if not already present)

python -m grpc_tools.protoc -I./proto --python_out=./proto --grpc_python_out=./proto ./proto/face_recognition.proto

6. Run the Server

python server.py

The server will start and listen on port 50051, displaying: [INFO] gRPC Face Recognition server running on port 50051


Usage Examples

Recognize a Face:
Send an image to the gRPC endpoint and receive the best matching employee with confidence score.

Enroll a New Employee:
Provide a name and image to add a new employee to the system.

List Employees:
Retrieve all employees and their associated face images.

Delete an Employee:
Remove an employee from the database by specifying their name.


Notes

  • Ensure that images are clear and well-lit for optimal face recognition accuracy.
  • The server is currently configured to run locally on port 50051. Modify server.py if a different port is required.
  • For production deployment, consider adding authentication and persistence beyond in-memory storage.

References