Update README.md
Browse files
README.md
CHANGED
@@ -9,4 +9,99 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
+
# Facerec π
|
13 |
+
|
14 |
+

|
15 |
+
|
16 |
+
**Facerec** is a comprehensive single-image face recognition system built with Gradio. Leveraging powerful technologies like YOLO for face detection, DeepSort for tracking, FaceNet for recognition, and Mediapipe for advanced functionalities such as blink detection, face mesh, eye color detection, and hand tracking, Facerec offers a robust solution for facial analysis and recognition tasks.
|
17 |
+
|
18 |
+
## π Features
|
19 |
+
|
20 |
+
- **Face Detection with YOLO:** High-precision face detection using the YOLO model.
|
21 |
+
- **Face Tracking with DeepSort:** Efficient tracking of detected faces across multiple images.
|
22 |
+
- **Face Recognition with FaceNet:** Accurate face recognition using deep learning embeddings.
|
23 |
+
- **Anti-Spoofing:** Detects potential spoofing attempts by analyzing image sharpness.
|
24 |
+
- **Blink Detection:** Identifies blinks using Eye Aspect Ratio (EAR) calculations.
|
25 |
+
- **Face Mesh & Iris Detection:** Visualizes facial landmarks, contours, tesselation, and irises.
|
26 |
+
- **Eye Color Detection:** Determines the dominant eye color from the iris region.
|
27 |
+
- **Hand Tracking with Mediapipe Hands:** Detects and tracks hands, displaying landmarks and connections.
|
28 |
+
- **Database Management:**
|
29 |
+
- **Enroll Users:** Add multiple images per user for recognition.
|
30 |
+
- **Search Users:** Search by name or image to find matching users.
|
31 |
+
- **Remove Users:** Delete user data from the database.
|
32 |
+
- **List Users:** View all enrolled users.
|
33 |
+
- **Customizable Configuration:** Toggle features, adjust thresholds, and customize colors via an intuitive interface.
|
34 |
+
|
35 |
+
## π₯ Installation
|
36 |
+
|
37 |
+
1. **Clone the Repository**
|
38 |
+
```bash
|
39 |
+
git clone https://github.com/yourusername/facerec.git
|
40 |
+
cd facerec
|
41 |
+
```
|
42 |
+
|
43 |
+
2. **Create a Virtual Environment (Optional but Recommended)**
|
44 |
+
```bash
|
45 |
+
python3 -m venv venv
|
46 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
47 |
+
```
|
48 |
+
|
49 |
+
3. **Install Dependencies**
|
50 |
+
```bash
|
51 |
+
pip install -r requirements.txt
|
52 |
+
```
|
53 |
+
|
54 |
+
4. **Download YOLO Model**
|
55 |
+
The application automatically downloads the YOLO face detection model (`face2.pt`) if it's not present.
|
56 |
+
|
57 |
+
## βοΈ Setup
|
58 |
+
|
59 |
+
1. **Initial Configuration**
|
60 |
+
Customize settings via the **Configuration** tab in the Gradio interface.
|
61 |
+
|
62 |
+
2. **Database Initialization**
|
63 |
+
The face embeddings database is stored at `~/.face_pipeline/known_faces.pkl`.
|
64 |
+
|
65 |
+
## π οΈ Usage
|
66 |
+
|
67 |
+
Launch the Gradio app by running:
|
68 |
+
```bash
|
69 |
+
python app.py
|
70 |
+
```
|
71 |
+
Access it at `http://localhost:7860/`.
|
72 |
+
|
73 |
+
### Image Test
|
74 |
+
|
75 |
+
1. **Upload an Image**
|
76 |
+
2. **Process Image**
|
77 |
+
3. **View Results**
|
78 |
+
|
79 |
+
### Configuration
|
80 |
+
|
81 |
+
Customize the application's behavior:
|
82 |
+
- **Feature Toggles:** Enable/disable specific features.
|
83 |
+
- **Thresholds:** Adjust confidence thresholds.
|
84 |
+
- **Color Customization:** Define colors for bounding boxes and overlays.
|
85 |
+
|
86 |
+
### Database Management
|
87 |
+
|
88 |
+
Manage users via the **Database Management** tab:
|
89 |
+
- **Enroll Users:** Upload images for recognition.
|
90 |
+
- **Search Users:** Search by name or image.
|
91 |
+
- **Remove Users:** Delete user data.
|
92 |
+
|
93 |
+
## π Database Management
|
94 |
+
|
95 |
+
Facerec maintains a database at `~/.face_pipeline/known_faces.pkl`.
|
96 |
+
|
97 |
+
## π License
|
98 |
+
|
99 |
+
Distributed under the [MIT License](LICENSE).
|
100 |
+
|
101 |
+
## π Acknowledgements
|
102 |
+
|
103 |
+
- [Gradio](https://gradio.app/)
|
104 |
+
- [YOLO](https://github.com/ultralytics/yolov5)
|
105 |
+
- [FaceNet](https://github.com/timesler/facenet-pytorch)
|
106 |
+
- [DeepSort](https://github.com/theAIGuysCode/deep_sort_realtime)
|
107 |
+
- [Mediapipe](https://mediapipe.dev/)
|