xtlyxt commited on
Commit
84a482e
·
verified ·
1 Parent(s): c3c87f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
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
- for emotion, score in result[0]["score"].items():
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: