Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,18 +2,10 @@ import gradio as gr
|
|
| 2 |
import numpy as np
|
| 3 |
import librosa
|
| 4 |
import tensorflow as tf
|
| 5 |
-
from huggingface_hub import hf_hub_download
|
| 6 |
-
|
| 7 |
-
# Repo chứa model
|
| 8 |
-
REPO_ID = "NV9523/emotion_recognition"
|
| 9 |
-
|
| 10 |
-
# Download model từ Hugging Face
|
| 11 |
-
female_model_path = hf_hub_download(repo_id=REPO_ID, filename="emotion_recognition_female.h5")
|
| 12 |
-
male_model_path = hf_hub_download(repo_id=REPO_ID, filename="emotion_recognition_male.h5")
|
| 13 |
|
| 14 |
# Load trained models
|
| 15 |
-
model_female = tf.keras.models.load_model(
|
| 16 |
-
model_male
|
| 17 |
|
| 18 |
# Constants
|
| 19 |
FRAME_LENGTH = 2048
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import librosa
|
| 4 |
import tensorflow as tf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Load trained models
|
| 7 |
+
model_female = tf.keras.models.load_model("emotion_recognition_female.h5")
|
| 8 |
+
model_male = tf.keras.models.load_model("emotion_recognition_male.h5")
|
| 9 |
|
| 10 |
# Constants
|
| 11 |
FRAME_LENGTH = 2048
|