|
17 | 17 | Mukh (मुख, meaning "face" in Sanskrit) is a comprehensive face analysis library that provides unified APIs for various face-related tasks. It simplifies the process of working with multiple face analysis models through a consistent interface. |
18 | 18 |
|
19 | 19 | ## Features |
20 | | - |
| 20 | +- 🥸 **Ensemble DeepFake Detector** The first python package featuring an Ensemble DeepFake Detector |
21 | 21 | - 🎯 **Unified API**: Single, consistent interface for multiple face analysis tasks |
22 | 22 | - 🔄 **Model Flexibility**: Support for multiple models per task |
23 | 23 | - 🛠️ **Custom Pipelines**: Optimized preprocessing and model combinations |
24 | | -- 🚀 **Easy to Use**: Simple, intuitive APIs for quick integration |
25 | 24 |
|
26 | 25 |
|
27 | 26 | ## Documentation |
@@ -66,6 +65,18 @@ detections = detector.detect( |
66 | 65 | ```python |
67 | 66 | python examples/face_detection/basic_detection.py --detection_model mediapipe |
68 | 67 | ``` |
| 68 | + |
| 69 | +### Input Image |
| 70 | +<img src = "https://github.com/ishandutta0098/mukh/blob/main/assets/images/img1.jpg" width=200> |
| 71 | + |
| 72 | +### Output Annotated Image |
| 73 | +<img src = "https://github.com/ishandutta0098/mukh/blob/main/assets/demos/face_detection/img1_detected.jpg" width=200> |
| 74 | +Annotated image with the bounding box and confidence |
| 75 | + |
| 76 | +```python |
| 77 | +image_name | x1 | y1 | x2 | y2 | confidence |
| 78 | + img1.jpg | 62 | 228 | 453 | 619 | 0.9381868243217468 |
| 79 | +``` |
69 | 80 |
|
70 | 81 | ## Face Reenactment |
71 | 82 |
|
@@ -94,6 +105,18 @@ python examples/reenactment/basic_reenactment.py \ |
94 | 105 | --driving_video_path assets/videos/video_1sec.mp4 \ |
95 | 106 | --output_folder output |
96 | 107 | ``` |
| 108 | + |
| 109 | +### Input |
| 110 | +#### Source Image |
| 111 | +<img src = "https://github.com/ishandutta0098/mukh/blob/main/assets/images/img1.jpg" width=200> |
| 112 | + |
| 113 | +#### Driving Video |
| 114 | + |
| 115 | +https://github.com/user-attachments/assets/8bfba67e-abb6-45a3-809f-bde58cce8b11 |
| 116 | + |
| 117 | +### Output |
| 118 | + |
| 119 | +https://github.com/user-attachments/assets/875ba692-ea78-42e3-9e03-d1f4703930be |
97 | 120 |
|
98 | 121 | ## Deepfake Detection |
99 | 122 |
|
@@ -132,6 +155,17 @@ python examples/deepfake_detection/detection.py \ |
132 | 155 | --media_path assets/images/img1.jpg \ |
133 | 156 | --confidence_threshold 0.5 |
134 | 157 | ``` |
| 158 | + |
| 159 | +### Input |
| 160 | +#### Source Image |
| 161 | +<img src = "https://github.com/ishandutta0098/mukh/blob/main/assets/images/img1.jpg" width=200> |
| 162 | + |
| 163 | +### Output |
| 164 | +```python |
| 165 | +media_name | frame_number | is_deepfake | confidence | model_name |
| 166 | +img1.jpg | 0 | False | 0.99 | ResNetInception |
| 167 | +``` |
| 168 | + |
135 | 169 |
|
136 | 170 | ### Videos |
137 | 171 | ```python |
@@ -170,6 +204,29 @@ python examples/deepfake_detection/detection.py \ |
170 | 204 | --confidence_threshold 0.5 \ |
171 | 205 | --num_frames 11 |
172 | 206 | ``` |
| 207 | + |
| 208 | +### Input |
| 209 | + |
| 210 | +https://github.com/user-attachments/assets/7a3b85de-d3cb-4c5f-90a7-3900a6132a00 |
| 211 | + |
| 212 | +### Output |
| 213 | +```python |
| 214 | + media_name | frame_number |is_deepfake|confidence| model_name |
| 215 | +deepfake_elon_musk.mp4 | 0 | True | 0.99 |EfficientNetAutoAttB4 |
| 216 | +deepfake_elon_musk.mp4 | 43 | True | 0.69 |EfficientNetAutoAttB4 |
| 217 | +deepfake_elon_musk.mp4 | 86 | False | 0.73 |EfficientNetAutoAttB4 |
| 218 | +deepfake_elon_musk.mp4 | 172 | True | 0.95 |EfficientNetAutoAttB4 |
| 219 | +deepfake_elon_musk.mp4 | 215 | True | 0.98 |EfficientNetAutoAttB4 |
| 220 | +deepfake_elon_musk.mp4 | 129 | True | 0.96 |EfficientNetAutoAttB4 |
| 221 | +deepfake_elon_musk.mp4 | 258 | True | 0.53 |EfficientNetAutoAttB4 |
| 222 | +deepfake_elon_musk.mp4 | 301 | True | 0.77 |EfficientNetAutoAttB4 |
| 223 | +deepfake_elon_musk.mp4 | 344 | False | 0.83 |EfficientNetAutoAttB4 |
| 224 | +deepfake_elon_musk.mp4 | 387 | True | 0.62 |EfficientNetAutoAttB4 |
| 225 | +deepfake_elon_musk.mp4 | 431 | False | 0.79 |EfficientNetAutoAttB4 |
| 226 | +``` |
| 227 | +```python |
| 228 | +| deepfake_elon_musk.mp4 | EfficientNetAutoAttB4 | 8/11 deepfake frames | Final: DEEPFAKE |
| 229 | +``` |
173 | 230 |
|
174 | 231 | ## Deepfake Detection Pipeline |
175 | 232 |
|
@@ -202,6 +259,41 @@ python examples/pipelines/deepfake_detection.py \ |
202 | 259 | --media_path assets/videos/deepfake_elon_musk.mp4 \ |
203 | 260 | --output_folder output/deepfake_detection_pipeline |
204 | 261 | ``` |
| 262 | + |
| 263 | +### Output |
| 264 | +**Ensemble confidence score** |
| 265 | +```python |
| 266 | +frame_number|is_deepfake|confidence |
| 267 | + 0 | True | 0.5 |
| 268 | + 43 | True | 0.84 |
| 269 | + 86 | True | 0.635 |
| 270 | + 129 | True | 0.98 |
| 271 | + 172 | True | 0.975 |
| 272 | + 215 | True | 0.99 |
| 273 | + 258 | True | 0.765 |
| 274 | + 301 | True | 0.885 |
| 275 | + 344 | True | 0.585 |
| 276 | + 387 | True | 0.81 |
| 277 | + 431 | True | 0.605 |
| 278 | +``` |
| 279 | + |
| 280 | +**Result from the respective models** |
| 281 | +```python |
| 282 | + | deepfake_elon_musk.mp4 | ResNetInception | 10/11 deepfake frames | Final: DEEPFAKE |
| 283 | + | deepfake_elon_musk.mp4 | EfficientNetAutoAttB4 | 8/11 deepfake frames | Final: DEEPFAKE |
| 284 | +``` |
| 285 | + |
| 286 | +**Final Pipeline Output** |
| 287 | +```python |
| 288 | +Final Ensemble Result: DEEPFAKE |
| 289 | +Deepfake frames: 11/11 |
| 290 | +Average confidence: 0.7791 |
| 291 | +Model configurations: { |
| 292 | + 'resnet_inception': 0.5, |
| 293 | + 'efficientnet': 0.5 |
| 294 | +} |
| 295 | +``` |
| 296 | + |
205 | 297 | ## Contact |
206 | 298 |
|
207 | 299 | For questions and feedback, please open an issue on GitHub. |
0 commit comments