Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
|
|
| 6 |
from PIL import Image
|
| 7 |
import tempfile
|
| 8 |
import os
|
| 9 |
-
import io
|
| 10 |
|
| 11 |
def generate_waveform_video(audio_file, image_file):
|
| 12 |
try:
|
|
@@ -45,7 +45,7 @@ def generate_waveform_video(audio_file, image_file):
|
|
| 45 |
|
| 46 |
# Convertir figura a numpy array usando io.BytesIO
|
| 47 |
buf = io.BytesIO()
|
| 48 |
-
plt.savefig(buf, format='png', bbox_inches='tight', pad_inches=0)
|
| 49 |
plt.close(fig)
|
| 50 |
return np.array(Image.open(buf))
|
| 51 |
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
import tempfile
|
| 8 |
import os
|
| 9 |
+
import io
|
| 10 |
|
| 11 |
def generate_waveform_video(audio_file, image_file):
|
| 12 |
try:
|
|
|
|
| 45 |
|
| 46 |
# Convertir figura a numpy array usando io.BytesIO
|
| 47 |
buf = io.BytesIO()
|
| 48 |
+
plt.savefig(buf, format='png', bbox_inches='tight', pad_inches=0, transparent=False)
|
| 49 |
plt.close(fig)
|
| 50 |
return np.array(Image.open(buf))
|
| 51 |
|