Arnab Das commited on
Commit
b9637be
·
1 Parent(s): 6fa9d76
Files changed (2) hide show
  1. app.py +6 -2
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from manipulate_model.utils import get_config_and_model, infere
3
 
4
 
@@ -10,14 +11,17 @@ def process(filepath):
10
  global manpulate_config
11
  out = infere(manipulate_model, filepath, manpulate_config)
12
  out = out.tolist()
13
- return str(out)
 
14
  demo = gr.Blocks()
15
  file_proc = gr.Interface(
16
  fn=process,
17
  inputs=[
18
  gr.Audio(sources=["microphone", "upload"], type="filepath", show_download_button=True, label="Speech file (<30s)", max_length=30),
19
  ],
20
- outputs="text",
 
 
21
  title="Find the manipulation: Analyze 'Real' or 'Manipulated' audio.",
22
  description=(
23
  "Analyze, detect and localize manipulation in an audio with a click of a button. Upload a .wav or .flac file."
 
1
  import gradio as gr
2
+ import matplotlib.pyplot as plt
3
  from manipulate_model.utils import get_config_and_model, infere
4
 
5
 
 
11
  global manpulate_config
12
  out = infere(manipulate_model, filepath, manpulate_config)
13
  out = out.tolist()
14
+ plt.plot(out)
15
+ return str(out), plt
16
  demo = gr.Blocks()
17
  file_proc = gr.Interface(
18
  fn=process,
19
  inputs=[
20
  gr.Audio(sources=["microphone", "upload"], type="filepath", show_download_button=True, label="Speech file (<30s)", max_length=30),
21
  ],
22
+ outputs=["text",
23
+ gr.Plot(label="Frame wise prediction")
24
+ ],
25
  title="Find the manipulation: Analyze 'Real' or 'Manipulated' audio.",
26
  description=(
27
  "Analyze, detect and localize manipulation in an audio with a click of a button. Upload a .wav or .flac file."
requirements.txt CHANGED
@@ -2,4 +2,5 @@ gradio==3.50.2
2
  torch==2.4.0
3
  torchaudio==2.4.0
4
  numpy==1.24.4
5
- omegaconf==2.3.0
 
 
2
  torch==2.4.0
3
  torchaudio==2.4.0
4
  numpy==1.24.4
5
+ omegaconf==2.3.0
6
+ matplotlib