badayvedat commited on
Commit
a29cf7e
1 Parent(s): 7187e4f

Add examples

Browse files
app.py CHANGED
@@ -7,6 +7,7 @@ import librosa
7
  import numpy as np
8
  import torch
9
 
 
10
  from pipeline import build_audiosep
11
 
12
  CHECKPOINTS_DIR = Path("checkpoint")
@@ -59,11 +60,11 @@ with gr.Blocks(title="AudioSep") as demo:
59
  gr.Markdown(description)
60
  with gr.Row():
61
  with gr.Column():
62
- input_audio = gr.Audio(type="filepath")
63
- text = gr.Textbox()
64
  with gr.Column():
65
  with gr.Column():
66
- output_audio = gr.Audio(scale=10)
67
  button = gr.Button(
68
  "Separate",
69
  variant="primary",
@@ -75,4 +76,7 @@ with gr.Blocks(title="AudioSep") as demo:
75
  fn=inference, inputs=[input_audio, text], outputs=[output_audio]
76
  )
77
 
 
 
 
78
  demo.queue().launch(share=True)
 
7
  import numpy as np
8
  import torch
9
 
10
+ from gradio_examples import EXAMPLES
11
  from pipeline import build_audiosep
12
 
13
  CHECKPOINTS_DIR = Path("checkpoint")
 
60
  gr.Markdown(description)
61
  with gr.Row():
62
  with gr.Column():
63
+ input_audio = gr.Audio(label="Mixture", type="filepath")
64
+ text = gr.Textbox(label="Text Query")
65
  with gr.Column():
66
  with gr.Column():
67
+ output_audio = gr.Audio(label="Separation Result", scale=10)
68
  button = gr.Button(
69
  "Separate",
70
  variant="primary",
 
76
  fn=inference, inputs=[input_audio, text], outputs=[output_audio]
77
  )
78
 
79
+ gr.Markdown("## Examples")
80
+ gr.Examples(examples=EXAMPLES, inputs=[input_audio, text])
81
+
82
  demo.queue().launch(share=True)
examples/acoustic_guitar.wav ADDED
Binary file (640 kB). View file
 
examples/laughing.wav ADDED
Binary file (320 kB). View file
 
examples/ticktok_piano.wav ADDED
Binary file (640 kB). View file
 
examples/water_drops.wav ADDED
Binary file (320 kB). View file
 
gradio_examples.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ CURR_DIR = Path(__file__).resolve().parent
4
+
5
+ EXAMPLES_DIR = CURR_DIR / "examples"
6
+
7
+ EXAMPLES = [
8
+ [EXAMPLES_DIR / "acoustic_guitar.wav", "acoustic guitar"],
9
+ [EXAMPLES_DIR / "laughing.wav", "laughing"],
10
+ [
11
+ EXAMPLES_DIR / "ticktok_piano.wav",
12
+ "A ticktock sound playing at the same rhythm with piano.",
13
+ ],
14
+ [EXAMPLES_DIR / "water_drops.wav", "water drops"],
15
+ ]