xtlyxt commited on
Commit
44298c3
·
verified ·
1 Parent(s): 5a99d16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -35,12 +35,6 @@ if st.button("Predict Emotions") and uploaded_images:
35
  col.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
36
  col.write(f"Emotion Scores for {predicted_emotion}: {results[i][0]['score']:.4f}")
37
 
38
- # Display scores for other categories
39
- st.write(f"Emotion Scores for other categories (Image {i+1}):")
40
- for label, score in zip(emotion_labels, results[i][0]["score"]):
41
- if label.lower() != predicted_emotion.lower(): # Exclude the predicted emotion
42
- st.write(f"{label}: {score:.4f}")
43
-
44
  # Display keys and values of all results for the current image
45
  st.write(f"Keys and Values of results[{i}] (Image {i+1}):")
46
  for key, value in results[i][0].items():
@@ -59,3 +53,8 @@ if st.button("Predict Emotions") and uploaded_images:
59
  st.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
60
  st.write(f"Emotion Scores for Image {i+1}:")
61
  st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
 
 
 
 
 
 
35
  col.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
36
  col.write(f"Emotion Scores for {predicted_emotion}: {results[i][0]['score']:.4f}")
37
 
 
 
 
 
 
 
38
  # Display keys and values of all results for the current image
39
  st.write(f"Keys and Values of results[{i}] (Image {i+1}):")
40
  for key, value in results[i][0].items():
 
53
  st.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
54
  st.write(f"Emotion Scores for Image {i+1}:")
55
  st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
56
+
57
+ # Display keys and values of all results for the current image
58
+ st.write(f"Keys and Values of results[{i}] (Image {i+1}):")
59
+ for key, value in result[0].items():
60
+ st.write(f"Key: {key}, Value: {value}")