Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,41 +1,34 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import inference_2 as inference
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
)
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
image_interface = gr.Interface(
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
)
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
app =
|
| 35 |
-
interface_list=[image_interface, video_interface, audio_interface],
|
| 36 |
-
tab_names=['Image inference', 'Video inference', 'Audio inference']
|
| 37 |
-
)
|
| 38 |
-
|
| 39 |
-
# Launch
|
| 40 |
-
if __name__ == "__main__":
|
| 41 |
-
app.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import inference_2 as inference
|
| 3 |
|
| 4 |
+
|
| 5 |
+
title="Multimodal deepfake detector"
|
| 6 |
+
description="Deepfake detection for videos, images and audio modalities."
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
video_interface = gr.Interface(inference.deepfakes_video_predict,
|
| 10 |
+
gr.Video(),
|
| 11 |
+
"text",
|
| 12 |
+
cache_examples = False
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
image_interface = gr.Interface(inference.deepfakes_image_predict,
|
| 17 |
+
gr.Image(),
|
| 18 |
+
"text",
|
| 19 |
+
examples = ["images/lady.jpg", "images/fake_image.jpg"],
|
| 20 |
+
cache_examples=False
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
audio_interface = gr.Interface(inference.deepfakes_spec_predict,
|
| 24 |
+
gr.Audio(),
|
| 25 |
+
"text",
|
| 26 |
+
examples = ["audios/DF_E_2000027.flac", "audios/DF_E_2000031.flac"],
|
| 27 |
+
cache_examples = False)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
app = gr.TabbedInterface(interface_list= [image_interface, video_interface, audio_interface],
|
| 31 |
+
tab_names = ['Image inference', 'Video inference', 'Audio inference'])
|
| 32 |
+
|
| 33 |
+
if __name__ == '__main__':
|
| 34 |
+
app.launch(share = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|