Abraham E. Tavarez commited on
Commit
3a57cd5
Β·
1 Parent(s): 99e6f81
Files changed (5) hide show
  1. .env.example +1 -0
  2. .gitattributes +35 -0
  3. .gitignore +2 -1
  4. README.md +150 -3
  5. requirements.txt +12 -0
.env.example ADDED
@@ -0,0 +1 @@
 
 
1
+ ANTHROPIC_API_KEY="sdk-"
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -9,4 +9,5 @@ wheels/
9
  # Virtual environments
10
  .venv
11
  app.copy.py
12
- app.audio.tool.py
 
 
9
  # Virtual environments
10
  .venv
11
  app.copy.py
12
+ app.audio.tool.py
13
+ assets/
README.md CHANGED
@@ -1,4 +1,151 @@
1
- # 🧠 Project Overview
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- Agent Name: Deepfake Watchdog
4
- Goal: Help users monitor the web for unauthorized use of their face or voice (e.g. deepfakes, impersonations).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: MCP Hackathon Deepfake Watchdog
3
+ emoji: πŸ›‘οΈ
4
+ colorFrom: green
5
+ colorTo: gray
6
+ sdk: gradio
7
+ sdk_version: 5.33.1
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ short_description: Upload your image and/or voice to scan for deepfake misuse o
12
+ ---
13
+ # πŸ›‘οΈ Deepfake Watchdog πŸ€–
14
 
15
+ 🏷️ Tags: `mcp-server-track` `agent-demo-track`
16
+
17
+ A multimodal AI agent that detects deepfake content using **face**, **voice**, and **video** verification. Built with 🧠 DeepFace, πŸ—£οΈ SpeechBrain, πŸŽ₯ OpenCV, and accelerated with ☁️ Modal for serverless GPU-powered execution. Designed for the **MCP HuggingFace's Hackathon**.
18
+
19
+ ![Deepfake Watchdog Banner](https://your-project-banner-url-if-any.com)
20
+
21
+ ---
22
+
23
+ ## πŸš€ Features
24
+
25
+ - πŸ§‘β€πŸ¦± **Face Verification**: Compare two faces and detect if they belong to the same person using DeepFace.
26
+ - πŸŽ™οΈ **Voice Verification**: Determine if two audio samples are from the same speaker with SpeechBrain.
27
+ - 🎞️ **Video Scan for Deepfakes**: Scan a video (or YouTube link) and match all faces against a reference image.
28
+ - πŸ“„ **PDF Report**: Generate a downloadable report with all scan results.
29
+ - 🧠 **Runs as an MCP Agent**: Compatible with [Gradio MCP](https://huggingface.co/docs/mcp), fully pluggable into agentic workflows.
30
+ - ⚑ **Modal Offloading**: GPU-backed execution for DeepFace & SpeechBrain using [Modal](https://modal.com).
31
+
32
+ ---
33
+
34
+ ## 🧱 Architecture
35
+
36
+ Gradio UI ──> MCP Agent ──> Modal Functions
37
+ └─> verify_faces_remote()
38
+ └─> verify_voices_remote()
39
+ └─> verify_faces_in_video_remote()
40
+
41
+
42
+ ---
43
+
44
+ ## 🧩 Tech Stack
45
+
46
+ | Tool | Purpose |
47
+ |--------------|----------------------------------|
48
+ | `Gradio` | Frontend UI + MCP integration |
49
+ | `Modal` | GPU offloading for ML workloads |
50
+ | `DeepFace` | Face verification |
51
+ | `SpeechBrain`| Voice verification |
52
+ | `OpenCV` | Video processing |
53
+ | `Pillow` | Image manipulation |
54
+ | `TensorFlow` | Required by DeepFace |
55
+ | `FFmpeg` | (Optional) for YouTube downloads |
56
+
57
+ ---
58
+
59
+ ## πŸ› οΈ Setup Instructions
60
+
61
+ ### 1. Clone the repo
62
+
63
+ ```bash
64
+ git clone https://huggingface.co/spaces/abetavarez/MCP-Hackathon-Deepfake-Watchdog
65
+ cd MCP-Hackathon-Deepfake-Watchdog
66
+ ```
67
+
68
+ ### 2. Create .env
69
+ ```bash
70
+ cp .env.example .env
71
+ # Add your API keys or configs if required
72
+ ```
73
+
74
+ ### 3. Install dependencies (locally)
75
+ ```bash
76
+ pip install -r requirements.txt
77
+ ```
78
+
79
+ ### 4. Run the app (with MCP)
80
+ ```bash
81
+ modal run app.py
82
+ ```
83
+
84
+ or for development::
85
+ ```bash
86
+ python app.py
87
+ ```
88
+
89
+ ## βš™οΈ Modal Setup
90
+ The app uses a single modal_app/backend.py file that defines:
91
+
92
+ verify_faces_remote
93
+
94
+ verify_voices_remote
95
+
96
+ verify_faces_in_video_remote
97
+
98
+ Each function is GPU-accelerated and runs independently on demand.
99
+
100
+ ```bash
101
+ modal deploy modal_app.py
102
+ ```
103
+
104
+ ## 🧠 Agent MCP Integration
105
+ This app runs as an MCP server using:
106
+
107
+ ```python
108
+ demo.launch(mcp_server=True)
109
+ ```
110
+ You can use this tool in your LlamaIndex, Hugging Face or LangChain agent as a remote service.
111
+
112
+ πŸ† Hackathon Tracks
113
+ βœ… Track 1: MCP Tool β€” Turned into a reusable tool with mcp_server=True
114
+ βœ… Track 3: Agentic Demo β€” A fully capable AI agent for deepfake detection (LlamaIndex)
115
+ βœ… Modal β€” Offloaded heavy tasks to Modal’s GPU cloud
116
+
117
+ ## 🧱 Folder Structure
118
+ .
119
+ β”œβ”€β”€ app.py # Main app entry point (Gradio + MCP)
120
+ β”œβ”€β”€ llama_agent.py # LlamaIndex Agent implementation
121
+ β”œβ”€β”€ tools.py # Tools for LlamaIndex Agent and MCP
122
+ β”œβ”€β”€ modal_app/
123
+ β”‚ β”œβ”€β”€ backend.py # Modal remote functions
124
+ β”œβ”€β”€ detector/
125
+ β”‚ β”œβ”€β”€ face.py # Local face verification logic
126
+ β”‚ β”œβ”€β”€ voice.py # Local voice verification logic
127
+ β”‚ └── video.py # Local video scan logic
128
+ β”œβ”€β”€ reports/
129
+ β”‚ └── pdf_report.py # PDF report generation
130
+ β”œβ”€β”€ utils/
131
+ β”‚ └── youtube_utils.py # YouTube download helper
132
+ β”œβ”€β”€ README.md
133
+ β”œβ”€β”€ requirements.txt
134
+ └── .env.example
135
+
136
+
137
+ ##πŸ§‘β€πŸ’» Author
138
+ Abraham Efren Tavarez
139
+ GitHub - [@AbeTavarez](https://github.com/AbeTavarez)
140
+ LinkedIn β€” [@abrahametavarez](https://www.linkedin.com/in/abrahametavarez/)
141
+
142
+ ## ✨ Future Improvements
143
+ Add S3-compatible cloud storage or video ingest
144
+
145
+ Add Nebius S3 support for video uploads
146
+
147
+ Add RAG-based evidence summarizer
148
+
149
+ Enable auto-scan via background agent
150
+
151
+ Add QR code for mobile voice capture
requirements.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ anthropic>=0.53.0
2
+ deepface>=0.0.93
3
+ fpdf>=1.7.2
4
+ gradio[mcp]>=5.32.1
5
+ llama-index>=0.12.41
6
+ llama-index-llms-anthropic>=0.7.2
7
+ modal>=1.0.3
8
+ opencv-python-headless>=4.11.0.86
9
+ pydub>=0.25.1
10
+ resemblyzer>=0.1.4
11
+ tf-keras>=2.19.0
12
+ yt-dlp>=2025.5.22