{"id":22344315,"url":"https://github.com/serverestaa/face_recognition","last_synced_at":"2026-02-07T19:34:19.384Z","repository":{"id":263160883,"uuid":"875551851","full_name":"serverestaa/face_recognition","owner":"serverestaa","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-23T10:21:04.000Z","size":29012,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T14:55:22.067Z","etag":null,"topics":["face-recognition","fastapi","grpc-python","pytorch-cnn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverestaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T09:39:49.000Z","updated_at":"2025-04-12T16:39:42.000Z","dependencies_parsed_at":"2025-01-31T11:38:22.194Z","dependency_job_id":null,"html_url":"https://github.com/serverestaa/face_recognition","commit_stats":null,"previous_names":["serverestaa/face_recognition"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serverestaa/face_recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverestaa%2Fface_recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverestaa%2Fface_recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverestaa%2Fface_recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverestaa%2Fface_recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverestaa","download_url":"https://codeload.github.com/serverestaa/face_recognition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverestaa%2Fface_recognition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29205272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["face-recognition","fastapi","grpc-python","pytorch-cnn"],"created_at":"2024-12-04T09:09:44.577Z","updated_at":"2026-02-07T19:34:19.378Z","avatar_url":"https://github.com/serverestaa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Verification\n\nThis project implements a face verification system using a combination of machine learning, image processing, and gRPC services. The system provides functionalities to train models, detect faces, encode them, and stream video with real-time face verification.\n\n**Paper Report** : [Baisbay_Shildebayev.pdf](https://github.com/user-attachments/files/17879113/Baisbay_Shildebayev.pdf)\n\n\nhttps://github.com/user-attachments/assets/e5a0dcc7-41d5-4bd2-b81a-7bf3f493cdc9\n\n---\n\n## Features\n\n1. **Face Encoding and Recognition**:\n   - Encodes face images using a pre-trained neural network.\n   - Matches encoded faces against known identities stored in a database.\n\n2. **Real-Time Face Detection**:\n   - Processes video streams and identifies faces in real time.\n   - Integrates with gRPC and FastAPI to expose APIs for face recognition and video streaming.\n\n3. **Model Training**:\n   - Train deep learning models using triplet loss for face encoding.\n   - Provides scripts for preprocessing datasets and training models.\n\n4. **Database Integration**:\n   - Stores face encodings and corresponding metadata in a SQLite database.\n   - Exposes API endpoints to retrieve and manage known faces.\n\n---\n\n## Project Structure\n\n| File                       | Description                                                             |\n|----------------------------|-------------------------------------------------------------------------|\n| `inference.py`             | Handles inference for face encoding and detection.                     |\n| `main.py`                  | Entry point for various services and utilities in the system.           |\n| `model_training.py`        | Script for training the deep learning model using triplet loss.         |\n| `preprocess.py`            | Prepares and processes datasets for model training.                    |\n| `utils.py`                 | Contains utility functions like dataset loaders and triplet loss computation. |\n| `face_storage_service.py`  | FastAPI-based service for storing and managing face encodings.          |\n| `streaming_service.py`     | Handles video streaming and real-time face recognition.                |\n| `service.py`               | gRPC server for encoding faces and providing recognition capabilities. |\n| `face_pb2.py`              | gRPC protocol buffer definitions for face recognition.                 |\n| `face_pb2_grpc.py`         | gRPC stubs and server interfaces generated from protocol buffer definitions. |\n\n---\n\n## Dataset used for training and validation:\n\nThe LFW dataset contains 13,233 images of faces collected from the web. This dataset consists of the 5749 identities with 1680 people with two or more images. \nhttps://www.kaggle.com/datasets/jessicali9530/lfw-dataset\n\nDataset used during inference:\n\n12 classes with 6-9 images which gives in total of 94 images. \nhttps://drive.google.com/drive/folders/17cku0kxf-tmfZyLz3HGCKFQ4mbn61Xwr?usp=sharing\n\n---\n\n## Prerequisites\n\n- **Python** 3.8+\n- `pipenv` or `virtualenv` for dependency management\n- A CUDA-enabled GPU (for training and inference)\n\n---\n\n## Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/yourusername/facerecognition\n   cd facerecognition\n   ```\n\n2. **Set up the Python environment and install dependencies**:\n   ```bash\n   pipenv install\n   pipenv shell\n   ```\n\n3. **Install additional requirements**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Start the SQLite database**:\n   ```bash\n   sqlite3 faces.db \u003c schema.sql\n   ```\n\n---\n\n## Usage\n\n1. **Start the gRPC Server**:\n   ```bash\n   python service.py\n   ```\n\n2. **Start the API Services**:\n   ```bash\n   uvicorn face_storage_service:app --host 0.0.0.0 --port 8000\n   ```\n\n3. **Start the Video Streaming**:\n   ```bash\n   uvicorn streaming_service:app --host 0.0.0.0 --port 8080\n   ```\n\n4. **Train the Model**:\n   ```bash\n   python main.py\n   ```\n\n---\n\n## API Endpoints\n\n### Face Storage Service:\n- **POST `/upload_face/`**: Upload a face image and store its encoding.\n- **GET `/get_known_faces/`**: Retrieve all known faces and their encodings.\n\n### Streaming Service:\n- **GET `/video_feed`**: Access the real-time video feed with face recognition overlays.\n\n---\n\n## Acknowledgments\n\nThis project utilizes:\n- **PyTorch** for model development and inference.\n- **FastAPI** for API creation.\n- **gRPC** for efficient client-server communication.\n\n---\n\n## Contribution\n\nContributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverestaa%2Fface_recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverestaa%2Fface_recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverestaa%2Fface_recognition/lists"}