GS123 commited on
Commit
8bac3fb
·
verified ·
1 Parent(s): bb001f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -1,6 +1,6 @@
1
  # import libraries
2
  import streamlit as st
3
- from streamlit_image_select import image_select
4
  import tensorflow as tf
5
  import numpy as np
6
  import cv2
@@ -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,6 +74,7 @@ if predict:
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)
 
 
1
  # import libraries
2
  import streamlit as st
3
+ # from streamlit_image_select import image_select
4
  import tensorflow as tf
5
  import numpy as np
6
  import cv2
 
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
+ pass
78
+ # image_array = np.array(Image.open(img))
79
+ # result_img = model_pred(model, image_array)
80
+ # st.image(result_img)