|
|
@@ -0,0 +1,81 @@
|
|
|
+# gRPC Face Recognition Service - Part 1
|
|
|
+
|
|
|
+A **Python gRPC server** for face recognition and employee management using [DeepFace](https://github.com/serengil/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 <repo_url>
|
|
|
+cd <repo_folder>
|
|
|
+
|
|
|
+### 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
|
|
|
+
|
|
|
+- [DeepFace GitHub Repository](https://github.com/serengil/deepface)
|
|
|
+- [gRPC Python Documentation](https://grpc.io/docs/languages/python/)
|