update
Browse files
app.py
CHANGED
@@ -51,10 +51,16 @@ def inference_gradio(input, model_choice): # input is audio waveform in [T, cha
|
|
51 |
spec_plot_gen = plot_spectrogram(spec_gen)
|
52 |
|
53 |
output_audio = (h.sampling_rate, output) # tuple for gr.Audio output
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
spec_plot_gen.canvas.get_width_height(),
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
)
|
59 |
|
60 |
return output_audio, output_image
|
|
|
51 |
spec_plot_gen = plot_spectrogram(spec_gen)
|
52 |
|
53 |
output_audio = (h.sampling_rate, output) # tuple for gr.Audio output
|
54 |
+
|
55 |
+
buffer = spec_plot_gen.canvas.buffer_rgba()
|
56 |
+
output_image = PIL.Image.frombuffer(
|
57 |
+
"RGBA",
|
58 |
spec_plot_gen.canvas.get_width_height(),
|
59 |
+
buffer,
|
60 |
+
"raw",
|
61 |
+
"RGBA",
|
62 |
+
0,
|
63 |
+
1
|
64 |
)
|
65 |
|
66 |
return output_audio, output_image
|