Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,22 @@
|
|
| 1 |
-
# app.py
|
| 2 |
import gradio as gr
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
outputs=[
|
| 9 |
-
gr.Audio(
|
| 10 |
-
gr.
|
| 11 |
-
gr.Textbox(label="KL Divergence 2DFT", interactive=False),
|
| 12 |
-
gr.Audio(type="filepath", label="Foreground Audio Repet"),
|
| 13 |
-
gr.Textbox(label="PSNR (dB) Repet", interactive=False),
|
| 14 |
-
gr.Textbox(label="KL Divergence Repet", interactive=False),
|
| 15 |
-
gr.Audio(type="filepath", label="Foreground Audio Repet Sim"),
|
| 16 |
-
gr.Textbox(label="PSNR (dB) Repet Sim", interactive=False),
|
| 17 |
-
gr.Textbox(label="KL Divergence Repet Sim", interactive=False)
|
| 18 |
],
|
| 19 |
-
title="
|
| 20 |
-
description="Upload
|
| 21 |
)
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import librosa
|
| 3 |
+
import soundfile as sf
|
| 4 |
+
import numpy as np
|
| 5 |
+
from utils import run_separation
|
| 6 |
|
| 7 |
+
def separate_and_play(file):
|
| 8 |
+
separated = run_separation(file)
|
| 9 |
+
return separated['background'], separated['foreground']
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=separate_and_play,
|
| 13 |
+
inputs=gr.Audio(type="filepath", label="Upload Mixed Audio"),
|
| 14 |
outputs=[
|
| 15 |
+
gr.Audio(label="Background"),
|
| 16 |
+
gr.Audio(label="Foreground"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
],
|
| 18 |
+
title="Speaker Source Separation",
|
| 19 |
+
description="Upload a mixed audio file to hear separated background and foreground tracks using traditional audio separation methods."
|
| 20 |
)
|
| 21 |
|
| 22 |
+
demo.launch()
|