criticalDanger commited on
Commit
3dc4d0a
1 Parent(s): e5673dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -5
app.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  # Load the models using pipeline
5
- audio_model = pipeline("audio-classification", model="MelodyMachine/Deepfake-audio-detection-V2")
6
  image_model = pipeline("image-classification", model="dima806/deepfake_vs_real_image_detection")
7
 
8
  # Define the prediction function
@@ -34,13 +33,9 @@ def update_interface(model_choice):
34
 
35
  # Create Gradio interface
36
  with gr.Blocks() as iface:
37
- model_choice = gr.Radio(choices=["Audio Deepfake Detection", "Image Deepfake Detection"], label="Select Model", value="Audio Deepfake Detection")
38
- audio_input = gr.Audio(type="filepath", label="Upload Audio File")
39
  image_input = gr.Image(type="filepath", label="Upload Image File", visible=False)
40
  output = gr.Label()
41
 
42
- model_choice.change(fn=update_interface, inputs=model_choice, outputs=[audio_input, image_input])
43
-
44
  submit_button = gr.Button("Submit")
45
  submit_button.click(fn=predict, inputs=[audio_input, image_input, model_choice], outputs=output)
46
 
 
2
  from transformers import pipeline
3
 
4
  # Load the models using pipeline
 
5
  image_model = pipeline("image-classification", model="dima806/deepfake_vs_real_image_detection")
6
 
7
  # Define the prediction function
 
33
 
34
  # Create Gradio interface
35
  with gr.Blocks() as iface:
 
 
36
  image_input = gr.Image(type="filepath", label="Upload Image File", visible=False)
37
  output = gr.Label()
38
 
 
 
39
  submit_button = gr.Button("Submit")
40
  submit_button.click(fn=predict, inputs=[audio_input, image_input, model_choice], outputs=output)
41