mprateek commited on
Commit
b3e9322
1 Parent(s): edb5c24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -46,20 +46,20 @@ if uploaded_image:
46
  'Fear': '#000000'
47
  }
48
 
49
- # Pie chart visualization
50
- fig_pie, ax_pie = plt.subplots(figsize=(4, 4))
51
- ax_pie.pie(emotion_counts, labels=emotion_counts.index, autopct='%1.1f%%', startangle=140, colors=pie_colors)
52
- ax_pie.axis('equal')
53
- ax_pie.set_title("Emotion Distribution")
54
- st.pyplot(fig_pie)
55
 
56
- # Bar chart visualization
57
- fig_bar, ax_bar = plt.subplots(figsize=(4, 4))
58
- emotion_counts.plot(kind='bar', color=pie_colors, ax=ax_bar)
59
- ax_bar.set_xlabel('Emotion')
60
- ax_bar.set_ylabel('Count')
61
- ax_bar.set_title("Emotion Count")
62
- ax_bar.yaxis.set_major_locator(plt.MaxNLocator(integer=True))
63
- for i in ax_bar.patches:
64
- ax_bar.text(i.get_x() + i.get_width() / 2, i.get_height() + 0.1, str(int(i.get_height())), ha='center', va='bottom')
65
- st.pyplot(fig_bar)
 
46
  'Fear': '#000000'
47
  }
48
 
49
+ # # Pie chart visualization
50
+ # fig_pie, ax_pie = plt.subplots(figsize=(4, 4))
51
+ # ax_pie.pie(emotion_counts, labels=emotion_counts.index, autopct='%1.1f%%', startangle=140, colors=pie_colors)
52
+ # ax_pie.axis('equal')
53
+ # ax_pie.set_title("Emotion Distribution")
54
+ # st.pyplot(fig_pie)
55
 
56
+ # # Bar chart visualization
57
+ # fig_bar, ax_bar = plt.subplots(figsize=(4, 4))
58
+ # emotion_counts.plot(kind='bar', color=pie_colors, ax=ax_bar)
59
+ # ax_bar.set_xlabel('Emotion')
60
+ # ax_bar.set_ylabel('Count')
61
+ # ax_bar.set_title("Emotion Count")
62
+ # ax_bar.yaxis.set_major_locator(plt.MaxNLocator(integer=True))
63
+ # for i in ax_bar.patches:
64
+ # ax_bar.text(i.get_x() + i.get_width() / 2, i.get_height() + 0.1, str(int(i.get_height())), ha='center', va='bottom')
65
+ # st.pyplot(fig_bar)