Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,6 +28,9 @@ if uploaded_image:
|
|
28 |
st.image(image, caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
|
29 |
|
30 |
# Display scores for each category
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
28 |
st.image(image, caption=f"Predicted emotion: {predicted_emotion}", use_column_width=True)
|
29 |
|
30 |
# Display scores for each category
|
31 |
+
if "scores" in results[0]:
|
32 |
+
st.write("Emotion Scores:")
|
33 |
+
for label, score in zip(emotion_labels, results[0]["scores"]):
|
34 |
+
st.write(f"{label}: {score:.4f}")
|
35 |
+
else:
|
36 |
+
st.write("Emotion scores not available for this prediction.")
|