Yulu Fu commited on
Commit
1336633
1 Parent(s): 51c1e80

Added Image deepfake detection Interface

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,14 +25,14 @@ def predict(audio, image, model_choice):
25
  print("Error during prediction:", e) # Debugging statement
26
  return {"error": str(e)}
27
 
28
- # Function to update the interface based on the selected model
29
  def update_interface(model_choice):
30
  if model_choice == "Audio Deepfake Detection":
31
  return gr.update(visible=True), gr.update(visible=False)
32
  elif model_choice == "Image Deepfake Detection":
33
  return gr.update(visible=False), gr.update(visible=True)
34
 
35
- # Create the 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")
 
25
  print("Error during prediction:", e) # Debugging statement
26
  return {"error": str(e)}
27
 
28
+ # Update interface based on the selected model
29
  def update_interface(model_choice):
30
  if model_choice == "Audio Deepfake Detection":
31
  return gr.update(visible=True), gr.update(visible=False)
32
  elif model_choice == "Image Deepfake Detection":
33
  return gr.update(visible=False), gr.update(visible=True)
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")