Update app.py
Browse files
app.py
CHANGED
@@ -40,12 +40,14 @@ def emotion_analysis(emotions):
|
|
40 |
def predict_image(pic):
|
41 |
#img = image.load_img(pic, grayscale=True, target_size=(48, 48))
|
42 |
#show_img=image.load_img(pic, grayscale=False, target_size=(200, 200))
|
|
|
43 |
x = image.img_to_array(pic)
|
|
|
44 |
x = np.expand_dims(x, axis = 0)
|
45 |
|
46 |
x /= 255
|
47 |
|
48 |
-
custom = new_model.predict(x
|
49 |
|
50 |
emotion_analysis(custom[0])
|
51 |
|
|
|
40 |
def predict_image(pic):
|
41 |
#img = image.load_img(pic, grayscale=True, target_size=(48, 48))
|
42 |
#show_img=image.load_img(pic, grayscale=False, target_size=(200, 200))
|
43 |
+
pic = pic.reshape([48, 48])
|
44 |
x = image.img_to_array(pic)
|
45 |
+
|
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 |
|