wli3221134 commited on
Commit
18c21b7
·
verified ·
1 Parent(s): 8bc7ac8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -84,7 +84,6 @@ def audio_deepfake_detection(demonstrations, query_audio_path):
84
  # Gradio 界面
85
  def gradio_ui():
86
  def detection_wrapper(demonstration_audio1, label1, demonstration_audio2, label2, demonstration_audio3, label3, query_audio):
87
- # 将输入音频和标签封装成列表
88
  demonstrations = [
89
  (demonstration_audio1, label1),
90
  (demonstration_audio2, label2),
@@ -92,17 +91,16 @@ def gradio_ui():
92
  ]
93
  return audio_deepfake_detection(demonstrations, query_audio)
94
 
95
- # 构建 Gradio 界面
96
  interface = gr.Interface(
97
- fn=detection_wrapper, # 主函数
98
  inputs=[
99
- gr.Audio(source="upload", type="filepath", label="Demonstration Audio 1"),
100
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 1"),
101
- gr.Audio(source="upload", type="filepath", label="Demonstration Audio 2"),
102
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 2"),
103
- gr.Audio(source="upload", type="filepath", label="Demonstration Audio 3"),
104
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 3"),
105
- gr.Audio(source="upload", type="filepath", label="Query Audio (Audio for Detection)")
106
  ],
107
  outputs=gr.JSON(label="Detection Results"),
108
  title="Audio Deepfake Detection System",
 
84
  # Gradio 界面
85
  def gradio_ui():
86
  def detection_wrapper(demonstration_audio1, label1, demonstration_audio2, label2, demonstration_audio3, label3, query_audio):
 
87
  demonstrations = [
88
  (demonstration_audio1, label1),
89
  (demonstration_audio2, label2),
 
91
  ]
92
  return audio_deepfake_detection(demonstrations, query_audio)
93
 
 
94
  interface = gr.Interface(
95
+ fn=detection_wrapper,
96
  inputs=[
97
+ gr.Audio(sources=["upload"], type="filepath", label="Demonstration Audio 1"),
98
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 1"),
99
+ gr.Audio(sources=["upload"], type="filepath", label="Demonstration Audio 2"),
100
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 2"),
101
+ gr.Audio(sources=["upload"], type="filepath", label="Demonstration Audio 3"),
102
  gr.Dropdown(choices=["bonafide", "spoof"], value="bonafide", label="Label 3"),
103
+ gr.Audio(sources=["upload"], type="filepath", label="Query Audio (Audio for Detection)")
104
  ],
105
  outputs=gr.JSON(label="Detection Results"),
106
  title="Audio Deepfake Detection System",