Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ if st.button("Predict Emotions") and selected_images:
|
|
77 |
# Plot pie chart
|
78 |
st.write("Emotion Distribution (Pie Chart):")
|
79 |
fig_pie, ax_pie = plt.subplots()
|
80 |
-
ax_pie.pie(emotion_counts, labels=emotion_counts.index, autopct='%1.1f%%', startangle=140)
|
81 |
ax_pie.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
|
82 |
st.pyplot(fig_pie)
|
83 |
|
@@ -88,4 +88,5 @@ if st.button("Predict Emotions") and selected_images:
|
|
88 |
ax_bar.set_xlabel('Emotion')
|
89 |
ax_bar.set_ylabel('Count')
|
90 |
ax_bar.set_title('Emotion Distribution')
|
|
|
91 |
st.pyplot(fig_bar)
|
|
|
77 |
# Plot pie chart
|
78 |
st.write("Emotion Distribution (Pie Chart):")
|
79 |
fig_pie, ax_pie = plt.subplots()
|
80 |
+
ax_pie.pie(emotion_counts, labels=emotion_counts.index, autopct='%1.1f%%', startangle=140, colors=['#ff9999','#66b3ff','#99ff99','#ffcc99'])
|
81 |
ax_pie.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
|
82 |
st.pyplot(fig_pie)
|
83 |
|
|
|
88 |
ax_bar.set_xlabel('Emotion')
|
89 |
ax_bar.set_ylabel('Count')
|
90 |
ax_bar.set_title('Emotion Distribution')
|
91 |
+
ax_bar.yaxis.set_major_locator(plt.MaxNLocator(integer=True)) # Ensure integer ticks on Y-axis
|
92 |
st.pyplot(fig_bar)
|