Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,15 +12,15 @@ st.title('Emotion Detector App')
|
|
| 12 |
# display banner image
|
| 13 |
st.image("banner_emotions.jpg")
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 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 |
-
|
| 78 |
-
|
| 79 |
-
|
| 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)
|
|
|