Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import numpy as np
|
|
10 |
|
11 |
|
12 |
|
13 |
-
model = load_model(os.path.join("model", "
|
14 |
|
15 |
|
16 |
def convert_class_to_emotion(pred):
|
@@ -27,14 +27,10 @@ def convert_class_to_emotion(pred):
|
|
27 |
# 6: 'disgust',
|
28 |
# 7: 'surprised'}
|
29 |
|
30 |
-
label_conversion = {0: '
|
31 |
-
1: '
|
32 |
-
2: '
|
33 |
-
3: '
|
34 |
-
4: 'very unhappy',
|
35 |
-
5: 'unhappy',
|
36 |
-
6: 'unhappy',
|
37 |
-
7: 'happy'}
|
38 |
|
39 |
return label_conversion[int(pred)]
|
40 |
|
@@ -61,14 +57,10 @@ def make_predictions(file, micro=None):
|
|
61 |
|
62 |
N = 8
|
63 |
theta = radar_factory(N, frame='polygon')
|
64 |
-
spoke_labels = np.array(['
|
65 |
-
'
|
66 |
-
'
|
67 |
-
'
|
68 |
-
'angry',
|
69 |
-
'fearful',
|
70 |
-
'disgust',
|
71 |
-
'surprised'])
|
72 |
fig_radar, axs = plt.subplots(figsize=(8, 8), nrows=1, ncols=1,
|
73 |
subplot_kw=dict(projection='radar'))
|
74 |
vec = model.predict(x)[0]
|
@@ -99,4 +91,4 @@ iface = gr.Interface(
|
|
99 |
examples=[[os.path.join("examples", filename)] for filename in os.listdir("examples")],
|
100 |
outputs=[gr.Textbox(label="Text output"), gr.Plot(), gr.Plot()]
|
101 |
)
|
102 |
-
iface.launch(
|
|
|
10 |
|
11 |
|
12 |
|
13 |
+
model = load_model(os.path.join("model", "Speech_Recognition_Model.h5"))
|
14 |
|
15 |
|
16 |
def convert_class_to_emotion(pred):
|
|
|
27 |
# 6: 'disgust',
|
28 |
# 7: 'surprised'}
|
29 |
|
30 |
+
label_conversion = {0: 'kata_sifat',
|
31 |
+
1: 'kata_benda',
|
32 |
+
2: 'kata_kerja',
|
33 |
+
3: 'kata_keterangan}
|
|
|
|
|
|
|
|
|
34 |
|
35 |
return label_conversion[int(pred)]
|
36 |
|
|
|
57 |
|
58 |
N = 8
|
59 |
theta = radar_factory(N, frame='polygon')
|
60 |
+
spoke_labels = np.array(['kata_sifat',
|
61 |
+
'kata_benda',
|
62 |
+
'kata_kerja',
|
63 |
+
'kata_keterangan'])
|
|
|
|
|
|
|
|
|
64 |
fig_radar, axs = plt.subplots(figsize=(8, 8), nrows=1, ncols=1,
|
65 |
subplot_kw=dict(projection='radar'))
|
66 |
vec = model.predict(x)[0]
|
|
|
91 |
examples=[[os.path.join("examples", filename)] for filename in os.listdir("examples")],
|
92 |
outputs=[gr.Textbox(label="Text output"), gr.Plot(), gr.Plot()]
|
93 |
)
|
94 |
+
iface.launch(debug=True)
|