Deepak107 commited on
Commit
a2ea8b4
1 Parent(s): a8b487e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,13 +4,13 @@ model = keras.models.load_model('facial_expression1.h5')
4
  class_names = ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']
5
 
6
  def predict_input_image(img):
7
- img_4d=img.reshape(-1,40,40,1)
8
  prediction=model.predict(img_4d)[0]
9
  return {class_names[i]: float(prediction[i]) for i in range(len(class_names))}
10
 
11
 
12
- image = gr.inputs.Image(shape=(40,40))
13
- label = gr.outputs.Label(num_top_classes=2)
14
 
15
  gr.Interface(fn=predict_input_image, inputs=image, outputs=label,interpretation='default').launch(debug='True')
16
 
 
4
  class_names = ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']
5
 
6
  def predict_input_image(img):
7
+ img_4d=img.reshape(-1,48,48,1)
8
  prediction=model.predict(img_4d)[0]
9
  return {class_names[i]: float(prediction[i]) for i in range(len(class_names))}
10
 
11
 
12
+ image = gr.inputs.Image(shape=(48,48))
13
+ label = gr.outputs.Label(num_top_classes=len(class_names))
14
 
15
  gr.Interface(fn=predict_input_image, inputs=image, outputs=label,interpretation='default').launch(debug='True')
16