Spaces:
Runtime error
Runtime error
Hendrik Schroeter
commited on
Add description
Browse files
app.py
CHANGED
|
@@ -39,9 +39,11 @@ def mix_at_snr(clean, noise, snr, eps=1e-10):
|
|
| 39 |
assert torch.isfinite(mixture).all()
|
| 40 |
return clean, noise, mixture
|
| 41 |
|
|
|
|
| 42 |
def as_gradio_audio(x):
|
| 43 |
sr = config.get("sr", "df", int)
|
| 44 |
-
return sr, (x/
|
|
|
|
| 45 |
|
| 46 |
def mix_and_denoise(speech, noise, snr):
|
| 47 |
print(speech, noise, snr)
|
|
@@ -74,7 +76,14 @@ outputs = [
|
|
| 74 |
gradio.outputs.Audio(label="Noisy"),
|
| 75 |
gradio.outputs.Audio(label="Enhanced"),
|
| 76 |
]
|
|
|
|
|
|
|
|
|
|
| 77 |
iface = gradio.Interface(
|
| 78 |
-
fn=mix_and_denoise,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
)
|
| 80 |
iface.launch()
|
|
|
|
| 39 |
assert torch.isfinite(mixture).all()
|
| 40 |
return clean, noise, mixture
|
| 41 |
|
| 42 |
+
|
| 43 |
def as_gradio_audio(x):
|
| 44 |
sr = config.get("sr", "df", int)
|
| 45 |
+
return sr, (x / 0x7FFF).to(torch.int16).cpu().numpy()
|
| 46 |
+
|
| 47 |
|
| 48 |
def mix_and_denoise(speech, noise, snr):
|
| 49 |
print(speech, noise, snr)
|
|
|
|
| 76 |
gradio.outputs.Audio(label="Noisy"),
|
| 77 |
gradio.outputs.Audio(label="Enhanced"),
|
| 78 |
]
|
| 79 |
+
description = (
|
| 80 |
+
"This demo denoises audio files using DeepFilterNet. Try it with your own voice!"
|
| 81 |
+
)
|
| 82 |
iface = gradio.Interface(
|
| 83 |
+
fn=mix_and_denoise,
|
| 84 |
+
inputs=inputs,
|
| 85 |
+
outputs=outputs,
|
| 86 |
+
examples=examples,
|
| 87 |
+
description=description,
|
| 88 |
)
|
| 89 |
iface.launch()
|