Spaces:
Running
Running
File size: 372 Bytes
9633d44 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import re
from PIL import Image
def clean_text(text):
text = re.sub(r"<[^>]+>", "", text) # Remove HTML
text = re.sub(r"[^a-zA-ZÀ-ÿ0-9\s]", "", text) # Remove caracteres especiais
return text.strip()
def resize_image(image, size=(224, 224)):
return image.resize(size)
def normalize_audio(audio_array):
return audio_array / max(abs(audio_array))
|