Spaces:
Sleeping
Sleeping
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)) | |