Views
No views yet
| Modèle | Test Accuracy |
|---|---|
| CNN from Scratch | 64.44% 🏆 |
| VGG16 Transfer | 41.86% |
| VGG16 Fine-tuné | 42.04% |
| Classe | Emoji |
|---|---|
| Angry | 😠 |
| Fear | 😨 |
| Happy | 😄 |
| Neutral | 😐 |
| Sad | 😢 |
| Surprise | 😲 |
1import tensorflow as tf
2import numpy as np
3from huggingface_hub import hf_hub_download
4
5# Télécharger le modèle
6model_path = hf_hub_download(
7 repo_id = "AmadouDiarouga/emotion-detection-cnn",
8 filename = "emotion_model.keras"
9)
10
11# Charger le modèle
12model = tf.keras.models.load_model(model_path)
13
14# Prédire sur une image 48x48 grayscale
15img = np.random.rand(1, 48, 48, 1).astype("float32") # Exemple
16preds = model.predict(img)
17print("Émotion prédite :", np.argmax(preds))emotion_model.keras — Modèle CNN complet (architecture + poids)class_indices.json — Mapping index → émotion