Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,14 +19,14 @@ def fun(a):
|
|
19 |
#reshape((-1,48,48,1))
|
20 |
pred=reloaded_model.predict(a)
|
21 |
pred_eth=reloaded_model_eth.predict(a)
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
b = np.round(pred[1][0][0])
|
27 |
-
|
28 |
|
29 |
-
return
|
30 |
|
31 |
|
32 |
gr.Interface(fn=fun, inputs=gr.inputs.Image(image_mode='L',type='numpy',invert_colors=False), outputs=["text","text","text"]).launch()
|
|
|
19 |
#reshape((-1,48,48,1))
|
20 |
pred=reloaded_model.predict(a)
|
21 |
pred_eth=reloaded_model_eth.predict(a)
|
22 |
+
dict_gender={0:'Male',1:'Female'}
|
23 |
+
dict_eth={0:"White", 1:"Black", 2:"Asian", 3:"Indian", 4:"Hispanic"}
|
24 |
|
25 |
+
a = dict_gender[np.round(pred[0][0][0])]
|
26 |
b = np.round(pred[1][0][0])
|
27 |
+
c = dict_eth[np.argmax(pred_eth)]
|
28 |
|
29 |
+
return a,b,c
|
30 |
|
31 |
|
32 |
gr.Interface(fn=fun, inputs=gr.inputs.Image(image_mode='L',type='numpy',invert_colors=False), outputs=["text","text","text"]).launch()
|