Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,11 +31,8 @@ if st.button("Predict Emotions") and uploaded_images:
|
|
31 |
predicted_class = result[0]["label"]
|
32 |
predicted_emotion = predicted_class.split("_")[-1].capitalize()
|
33 |
st.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
|
34 |
-
|
35 |
-
# Display scores for all categories
|
36 |
st.write(f"Emotion Scores for Image {i+1}:")
|
37 |
-
|
38 |
-
st.write(f"{emotion.capitalize()}: {score:.4f}")
|
39 |
|
40 |
# If only two images and not the last image, display side by side
|
41 |
if num_images == 2 and i == 0:
|
|
|
31 |
predicted_class = result[0]["label"]
|
32 |
predicted_emotion = predicted_class.split("_")[-1].capitalize()
|
33 |
st.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
|
|
|
|
|
34 |
st.write(f"Emotion Scores for Image {i+1}:")
|
35 |
+
st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
|
|
|
36 |
|
37 |
# If only two images and not the last image, display side by side
|
38 |
if num_images == 2 and i == 0:
|