Spaces:
Sleeping
Sleeping
felix.wf
commited on
Commit
·
7e8df8d
1
Parent(s):
9db8a5d
refine page
Browse files
app.py
CHANGED
@@ -127,11 +127,11 @@ if file_name is not None:
|
|
127 |
labels_refined = [item['label'] for item in output_list_emotions_refined]
|
128 |
label_counts_refined = {label: labels_refined.count(label) for label in set(labels_refined)}
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
|
136 |
labels_emotions = [item['label'] for item in output_list_emotions]
|
137 |
label_counts_emotions = {label: labels_emotions.count(label) for label in set(labels_emotions)}
|
@@ -147,10 +147,12 @@ if file_name is not None:
|
|
147 |
|
148 |
st.pyplot(fig) # Display the stitched person images
|
149 |
|
150 |
-
st.
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
154 |
|
155 |
elif file_name.type.startswith('video'):
|
156 |
# Save the uploaded video to a temporary file
|
|
|
127 |
labels_refined = [item['label'] for item in output_list_emotions_refined]
|
128 |
label_counts_refined = {label: labels_refined.count(label) for label in set(labels_refined)}
|
129 |
|
130 |
+
bar_fig_actions, bar_ax_actions = plt.subplots()
|
131 |
+
bar_ax_actions.bar(label_counts_refined.keys(), label_counts_refined.values())
|
132 |
+
bar_ax_actions.set_title('Distribution of Actions')
|
133 |
+
bar_ax_actions.set_xlabel('Emotions')
|
134 |
+
bar_ax_actions.set_ylabel('Count')
|
135 |
|
136 |
labels_emotions = [item['label'] for item in output_list_emotions]
|
137 |
label_counts_emotions = {label: labels_emotions.count(label) for label in set(labels_emotions)}
|
|
|
147 |
|
148 |
st.pyplot(fig) # Display the stitched person images
|
149 |
|
150 |
+
col1, col2 = st.columns(2)
|
151 |
+
col1.pyplot(pie_fig_emotions) # Display the pie chart
|
152 |
+
col2.pyplot(bar_fig_emotions) # Display the bar chart
|
153 |
+
|
154 |
+
col1.pyplot(pie_fig_actions) # Display the pie chart
|
155 |
+
col2.pyplot(bar_fig_actions) # Display the bar chart
|
156 |
|
157 |
elif file_name.type.startswith('video'):
|
158 |
# Save the uploaded video to a temporary file
|