Update app.py
Browse files
app.py
CHANGED
|
@@ -64,24 +64,61 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 64 |
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
| 65 |
""")
|
| 66 |
|
| 67 |
-
gr.Markdown("#
|
| 68 |
|
| 69 |
with gr.Tabs():
|
| 70 |
|
|
|
|
| 71 |
# HOME TAB
|
|
|
|
| 72 |
with gr.Tab("Home"):
|
| 73 |
gr.Markdown("""
|
| 74 |
-
## Welcome
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
gr.Markdown("""
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
-
|
|
|
|
| 81 |
""")
|
| 82 |
-
gr.Markdown("Use the tabs above to proceed.")
|
| 83 |
|
|
|
|
| 84 |
# IMAGE TAB
|
|
|
|
| 85 |
with gr.Tab("Image Deepfake"):
|
| 86 |
gr.Markdown("## Deepfake Image Detection")
|
| 87 |
|
|
@@ -116,7 +153,9 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 116 |
outputs=[image_input, img_pred, img_conf, img_risk]
|
| 117 |
)
|
| 118 |
|
|
|
|
| 119 |
# AUDIO TAB
|
|
|
|
| 120 |
with gr.Tab("Audio Deepfake"):
|
| 121 |
gr.Markdown("## Deepfake Audio Detection")
|
| 122 |
|
|
|
|
| 64 |
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
| 65 |
""")
|
| 66 |
|
| 67 |
+
gr.Markdown("# AI Driven Deepfake Detection System")
|
| 68 |
|
| 69 |
with gr.Tabs():
|
| 70 |
|
| 71 |
+
# =========================
|
| 72 |
# HOME TAB
|
| 73 |
+
# =========================
|
| 74 |
with gr.Tab("Home"):
|
| 75 |
gr.Markdown("""
|
| 76 |
+
## Welcome
|
| 77 |
+
|
| 78 |
+
This system detects AI-generated (deepfake) content in images and audio using
|
| 79 |
+
transformer-based deep learning models.
|
| 80 |
+
""")
|
| 81 |
+
|
| 82 |
+
gr.Markdown("""
|
| 83 |
+
### Supported inputs
|
| 84 |
+
- Images: JPG, PNG (face-centric images recommended)
|
| 85 |
+
- Audio: WAV format (clear speech preferred)
|
| 86 |
+
""")
|
| 87 |
+
|
| 88 |
+
gr.Markdown("""
|
| 89 |
+
### How to use
|
| 90 |
+
1. Select a detection mode using the tabs above.
|
| 91 |
+
2. Upload an image or audio file.
|
| 92 |
+
3. Click **Submit** to start analysis.
|
| 93 |
+
4. Review the prediction, confidence score, and risk assessment.
|
| 94 |
""")
|
| 95 |
+
|
| 96 |
+
gr.Markdown("""
|
| 97 |
+
### Understanding the results
|
| 98 |
+
- **Prediction**: Model decision (Real / Fake)
|
| 99 |
+
- **Confidence**: Certainty percentage of the prediction
|
| 100 |
+
- **Risk Assessment**:
|
| 101 |
+
- High likelihood → strong indication
|
| 102 |
+
- Possibly → caution advised
|
| 103 |
+
- Uncertain → manual review recommended
|
| 104 |
+
""")
|
| 105 |
+
|
| 106 |
+
gr.Markdown("""
|
| 107 |
+
### Explainability
|
| 108 |
+
For images, attention heatmaps highlight the facial regions that influenced
|
| 109 |
+
the model’s decision, supporting transparency and forensic analysis.
|
| 110 |
+
""")
|
| 111 |
+
|
| 112 |
gr.Markdown("""
|
| 113 |
+
### Data privacy & intended use
|
| 114 |
+
Uploaded files are processed temporarily and are not stored.
|
| 115 |
+
This system is intended as a decision-support tool and should not be used
|
| 116 |
+
as the sole source of verification.
|
| 117 |
""")
|
|
|
|
| 118 |
|
| 119 |
+
# =========================
|
| 120 |
# IMAGE TAB
|
| 121 |
+
# =========================
|
| 122 |
with gr.Tab("Image Deepfake"):
|
| 123 |
gr.Markdown("## Deepfake Image Detection")
|
| 124 |
|
|
|
|
| 153 |
outputs=[image_input, img_pred, img_conf, img_risk]
|
| 154 |
)
|
| 155 |
|
| 156 |
+
# =========================
|
| 157 |
# AUDIO TAB
|
| 158 |
+
# =========================
|
| 159 |
with gr.Tab("Audio Deepfake"):
|
| 160 |
gr.Markdown("## Deepfake Audio Detection")
|
| 161 |
|