Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ uploaded_images = st.file_uploader("Upload images", type=["jpg", "png"], accept_
|
|
18 |
# Display thumbnail images alongside file names and sizes in the sidebar
|
19 |
selected_images = []
|
20 |
if uploaded_images:
|
|
|
21 |
for idx, img in enumerate(uploaded_images):
|
22 |
image = Image.open(img)
|
23 |
checkbox_key = f"{img.name}_checkbox_{idx}" # Unique key for each checkbox
|
@@ -66,3 +67,4 @@ if st.button("Predict Emotions") and selected_images:
|
|
66 |
st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
|
67 |
# Use the index to get the corresponding filename
|
68 |
st.write(f"Original File Name: {uploaded_images[i].name if i < len(uploaded_images) else 'Unknown'}")
|
|
|
|
18 |
# Display thumbnail images alongside file names and sizes in the sidebar
|
19 |
selected_images = []
|
20 |
if uploaded_images:
|
21 |
+
uploaded_images = list(reversed(uploaded_images)) # Reverse the order of uploaded images
|
22 |
for idx, img in enumerate(uploaded_images):
|
23 |
image = Image.open(img)
|
24 |
checkbox_key = f"{img.name}_checkbox_{idx}" # Unique key for each checkbox
|
|
|
67 |
st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
|
68 |
# Use the index to get the corresponding filename
|
69 |
st.write(f"Original File Name: {uploaded_images[i].name if i < len(uploaded_images) else 'Unknown'}")
|
70 |
+
|