Update app.py
Browse files
app.py
CHANGED
@@ -42,12 +42,12 @@ def predict_image(pic):
|
|
42 |
#show_img=image.load_img(pic, grayscale=False, target_size=(200, 200))
|
43 |
#pic = pic.reshape(-1,48, 48,1])
|
44 |
x = image.img_to_array(pic)
|
45 |
-
|
46 |
x = np.expand_dims(x, axis = 0)
|
47 |
|
48 |
-
|
49 |
|
50 |
-
custom = new_model.predict(x
|
51 |
|
52 |
emotion_analysis(custom[0])
|
53 |
|
|
|
42 |
#show_img=image.load_img(pic, grayscale=False, target_size=(200, 200))
|
43 |
#pic = pic.reshape(-1,48, 48,1])
|
44 |
x = image.img_to_array(pic)
|
45 |
+
x = x.reshape(-1,48,48,1)
|
46 |
x = np.expand_dims(x, axis = 0)
|
47 |
|
48 |
+
x /= 255
|
49 |
|
50 |
+
custom = new_model.predict(x)
|
51 |
|
52 |
emotion_analysis(custom[0])
|
53 |
|