Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,13 +76,22 @@ if st.button("Predict Emotions") and selected_images:
|
|
76 |
|
77 |
# Define a color map that matches the emotions to specific colors
|
78 |
color_map = {
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
|
|
|
|
|
|
83 |
# Add more emotions and their corresponding colors here
|
84 |
}
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
# Use the color map to assign colors to the pie chart
|
87 |
pie_colors = [color_map.get(emotion, '#999999') for emotion in emotion_counts.index] # Default to grey if not found
|
88 |
|
|
|
76 |
|
77 |
# Define a color map that matches the emotions to specific colors
|
78 |
color_map = {
|
79 |
+
'Neutral': '#B38B6D', # Taupe
|
80 |
+
'Happy': '#FFFF00', # Yellow
|
81 |
+
'Sad': '#0000FF', # Blue
|
82 |
+
'Angry': '#FF0000', # Red
|
83 |
+
'Disgust': '#008000', # Green
|
84 |
+
'Surprise': '#FFA500', # Orange (Bright)
|
85 |
+
'Fear': '#000000' # Black
|
86 |
# Add more emotions and their corresponding colors here
|
87 |
}
|
88 |
|
89 |
+
#https://link.springer.com/article/10.3758/s13428-015-0598-8#:~:text=The%20color%20red%20was%20most%20associated%20with%20anger%2C%20green%20with,%E2%80%9D%20or%20%E2%80%9Cfeeling%20blue.%E2%80%9D
|
90 |
+
|
91 |
+
#The color red was most associated with anger, green with disgust, black with fear, yellow with happiness, blue with sadness,
|
92 |
+
#and bright with surprise. These associations may be a result of various expressions containing color terms that are used in the
|
93 |
+
#English language—for example, “seeing red” or “feeling blue.”May 19, 2015
|
94 |
+
|
95 |
# Use the color map to assign colors to the pie chart
|
96 |
pie_colors = [color_map.get(emotion, '#999999') for emotion in emotion_counts.index] # Default to grey if not found
|
97 |
|