GS123 commited on
Commit
82443bc
·
verified ·
1 Parent(s): e1818cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -12,15 +12,15 @@ st.title('Emotion Detector App')
12
  # display banner image
13
  st.image("banner_emotions.jpg")
14
 
15
- # img = image_select(
16
- # label = "Select an image to run model",
17
- # images = ["test_images/angry1.jpg",
18
- # "test_images/angry2.jpg",
19
- # "test_images/happy1.jpg",
20
- # "test_images/happy2.jpg",
21
- # "test_images/sad1.jpg",
22
- # "test_images/sad2.jpg"]
23
- # )
24
 
25
  uploaded_img = st.file_uploader("Upload an image file",
26
  type = ["png", "jpg", "jpeg"])
@@ -74,7 +74,6 @@ if predict:
74
  st.write("Please upload a valid image")
75
 
76
  else:
77
- pass
78
- # image_array = np.array(Image.open(img))
79
- # result_img = model_pred(model, image_array)
80
- # st.image(result_img)
 
12
  # display banner image
13
  st.image("banner_emotions.jpg")
14
 
15
+ img = image_select(
16
+ label = "Select an image to run model",
17
+ images = ["test_images/angry1.jpg",
18
+ "test_images/angry2.jpg",
19
+ "test_images/happy1.jpg",
20
+ "test_images/happy2.jpg",
21
+ "test_images/sad1.jpg",
22
+ "test_images/sad2.jpg"]
23
+ )
24
 
25
  uploaded_img = st.file_uploader("Upload an image file",
26
  type = ["png", "jpg", "jpeg"])
 
74
  st.write("Please upload a valid image")
75
 
76
  else:
77
+ image_array = np.array(Image.open(img))
78
+ result_img = model_pred(model, image_array)
79
+ st.image(result_img)