Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
696e7d4
1
Parent(s):
43b9586
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,16 +68,16 @@ def inference(audio):
|
|
| 68 |
# Save
|
| 69 |
soundfile.write(x_save_path, wav_x, model_sr, 'PCM_16')
|
| 70 |
soundfile.write(xrec_save_path, wav_xrec, model_sr, 'PCM_16')
|
| 71 |
-
return 'vocoded_orig_spec.wav', f'specvqgan_{bitrate:.2f}kbps.wav'
|
| 72 |
-
|
| 73 |
-
title = "
|
| 74 |
-
description = "demo for
|
| 75 |
-
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/
|
| 76 |
|
| 77 |
gr.Interface(
|
| 78 |
inference,
|
| 79 |
gr.inputs.Audio(type="file", label="Input Audio"),
|
| 80 |
-
[gr.outputs.Audio(type="file", label="Original audio"),gr.outputs.Audio(type="file", label="Reconstructed audio")],
|
| 81 |
title=title,
|
| 82 |
description=description,
|
| 83 |
article=article,
|
|
|
|
| 68 |
# Save
|
| 69 |
soundfile.write(x_save_path, wav_x, model_sr, 'PCM_16')
|
| 70 |
soundfile.write(xrec_save_path, wav_xrec, model_sr, 'PCM_16')
|
| 71 |
+
return 'vocoded_orig_spec.wav', f'specvqgan_{bitrate:.2f}kbps.wav', tensor_to_plt(x, flip_dims=(2,)), tensor_to_plt(xrec, flip_dims=(2,))
|
| 72 |
+
|
| 73 |
+
title = "SpecVQGAN Neural Audio Codec"
|
| 74 |
+
description = "Gradio demo for Spectrogram VQGAN as a Neural Audio Codec. To use it, simply add your audio, or click one of the examples to load them. Read more at the links below."
|
| 75 |
+
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2110.08791'>Taming Visually Guided Sound Generation</a> | <a href='https://github.com/v-iashin/SpecVQGAN'>Github Repo</a></p>"
|
| 76 |
|
| 77 |
gr.Interface(
|
| 78 |
inference,
|
| 79 |
gr.inputs.Audio(type="file", label="Input Audio"),
|
| 80 |
+
[gr.outputs.Audio(type="file", label="Original audio"),gr.outputs.Audio(type="file", label="Reconstructed audio"),"plot","plot"],
|
| 81 |
title=title,
|
| 82 |
description=description,
|
| 83 |
article=article,
|