xtlyxt commited on
Commit
1f83735
·
verified ·
1 Parent(s): ac8de0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -77,16 +77,25 @@ if st.button("Predict Emotions") and uploaded_images:
77
  # st.write(f"{label}: {score}")
78
 
79
  # working, but double display
 
 
 
 
 
 
 
 
 
 
80
  for i, result in enumerate(results):
81
  st.write(f"Keys and Values of results[{i}]:")
82
  for res in result:
83
- for key, value in res.items():
84
- if key == 'label':
85
- label = value
86
- elif key == 'score':
87
- score = value
88
- st.write(f"{label}: {score}")
89
 
 
90
 
91
 
92
  #working, but double display
 
77
  # st.write(f"{label}: {score}")
78
 
79
  # working, but double display
80
+ #for i, result in enumerate(results):
81
+ # st.write(f"Keys and Values of results[{i}]:")
82
+ # for res in result:
83
+ # for key, value in res.items():
84
+ # if key == 'label':
85
+ # label = value
86
+ # elif key == 'score':
87
+ # score = value
88
+ # st.write(f"{label}: {score}")
89
+
90
  for i, result in enumerate(results):
91
  st.write(f"Keys and Values of results[{i}]:")
92
  for res in result:
93
+ label = res["label"]
94
+ score = res["score"]
95
+ st.write(f"{label}: {score:.4f}")
96
+
 
 
97
 
98
+
99
 
100
 
101
  #working, but double display