Spaces:
Build error
Build error
Commit
·
8a89405
1
Parent(s):
27c9c9c
app.py updated
Browse files
app.py
CHANGED
|
@@ -6,13 +6,13 @@ from radar_chart import radar_factory
|
|
| 6 |
|
| 7 |
from keras.models import load_model
|
| 8 |
import os
|
| 9 |
-
import joblib
|
| 10 |
import numpy as np
|
| 11 |
import soundfile as sf
|
| 12 |
|
| 13 |
|
| 14 |
-
model = joblib.load('Speech_Emotion_Detection_Model.pkl')
|
| 15 |
-
|
| 16 |
|
| 17 |
def convert_class_to_emotion(pred):
|
| 18 |
"""
|
|
@@ -28,12 +28,14 @@ def convert_class_to_emotion(pred):
|
|
| 28 |
# 6: 'disgust',
|
| 29 |
# 7: 'surprised'}
|
| 30 |
|
| 31 |
-
label_conversion = {'
|
| 32 |
-
'
|
| 33 |
-
'
|
| 34 |
-
'
|
| 35 |
-
'
|
| 36 |
-
'
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
return label_conversion[int(pred)]
|
|
|
|
| 6 |
|
| 7 |
from keras.models import load_model
|
| 8 |
import os
|
| 9 |
+
#import joblib
|
| 10 |
import numpy as np
|
| 11 |
import soundfile as sf
|
| 12 |
|
| 13 |
|
| 14 |
+
#model = joblib.load('Speech_Emotion_Detection_Model.pkl')
|
| 15 |
+
model = load_model(os.path.join("lstm_all_four_complex.h5"))
|
| 16 |
|
| 17 |
def convert_class_to_emotion(pred):
|
| 18 |
"""
|
|
|
|
| 28 |
# 6: 'disgust',
|
| 29 |
# 7: 'surprised'}
|
| 30 |
|
| 31 |
+
label_conversion = {'neutral':'neutral',
|
| 32 |
+
'calm': 'calm',
|
| 33 |
+
'happy':'happy',
|
| 34 |
+
'sad':'sad',
|
| 35 |
+
'angry':'angry',
|
| 36 |
+
'fearful':'fearful',
|
| 37 |
+
'disgust':'disgust',
|
| 38 |
+
'ps': 'surprised'
|
| 39 |
}
|
| 40 |
|
| 41 |
return label_conversion[int(pred)]
|