jmparejaz commited on
Commit
6ec5987
1 Parent(s): 2287226

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- #dict_gender={0:'Male',1:'Female'}
23
- #dict_eth={0:"White", 1:"Black", 2:"Asian", 3:"Indian", 4:"Hispanic"}
24
 
25
- #a = dict_gender[pred[0][0][0]]
26
  b = np.round(pred[1][0][0])
27
- #c = dict_eth[np.argmax(pred_eth)]
28
 
29
- return pred[0][0][0],b,np.argmax(pred_eth)
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()