xtlyxt commited on
Commit
9218be1
·
verified ·
1 Parent(s): 059d006

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -33,13 +33,16 @@ if st.button("Predict Emotions") and uploaded_images:
33
  col.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
34
  col.write(f"Emotion Scores: {predicted_emotion}: {results[i][0]['score']:.4f}")
35
  col.write(f"Original File Name: {file_names[i]}") # Display original file name
 
 
 
36
 
37
  # Display the keys and values of all results
38
- st.write("Emotion Score Summary :")
39
  col1, col2 = st.columns(2)
40
  for i, result in enumerate(results):
41
  col = col1 if i == 0 else col2
42
- col.write(f"results for #[{i+1}] image")
43
  for res in result:
44
  label = res["label"]
45
  score = res["score"]
@@ -60,3 +63,6 @@ if st.button("Predict Emotions") and uploaded_images:
60
  st.write(f"Emotion Scores for #{i+1} Image")
61
  st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
62
  st.write(f"Original File Name: {uploaded_images[i].name}") # Display original file name
 
 
 
 
33
  col.image(images[i], caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
34
  col.write(f"Emotion Scores: {predicted_emotion}: {results[i][0]['score']:.4f}")
35
  col.write(f"Original File Name: {file_names[i]}") # Display original file name
36
+ # Display thumbnail view
37
+ col.write(f"Thumbnail:")
38
+ col.image(images[i], use_column_width='auto')
39
 
40
  # Display the keys and values of all results
41
+ st.write("Keys and Values of all results:")
42
  col1, col2 = st.columns(2)
43
  for i, result in enumerate(results):
44
  col = col1 if i == 0 else col2
45
+ col.write(f"Keys and Values of results[{i}]:")
46
  for res in result:
47
  label = res["label"]
48
  score = res["score"]
 
63
  st.write(f"Emotion Scores for #{i+1} Image")
64
  st.write(f"{predicted_emotion}: {result[0]['score']:.4f}")
65
  st.write(f"Original File Name: {uploaded_images[i].name}") # Display original file name
66
+ # Display thumbnail view
67
+ st.write(f"Thumbnail:")
68
+ st.image(images[i], use_column_width='auto')