Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,10 @@ 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 |
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 |
+
return dict_gender[pred[0][0][0]],np.round(pred[1][0][0]),dict_eth[np.argmax(pred_eth)]
|
26 |
|
27 |
|
28 |
gr.Interface(fn=fun, inputs=gr.inputs.Image(image_mode='L',type='numpy',invert_colors=False), outputs=["text","text","text"]).launch()
|