Spaces:
Sleeping
Sleeping
File size: 4,915 Bytes
71b20ff |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
dist_df = pd.read_csv('./csv/distribution.csv')
st.set_page_config(
page_title="Facial Emotion Classification",
layout="wide",
initial_sidebar_state="expanded",
)
def distribution():
# distribution plot
st.header("Image Distribution")
fig = px.bar(dist_df,
x="label", y="count",
labels={"label": "Emotions", "count": "Image Count"},
color="label", template="plotly_white")
fig.update_layout(height=600)
# Show the plot
st.plotly_chart(fig, use_container_width=True)
st.markdown('''
''')
def samples():
st.header("Image Samples")
sample_img = st.sidebar.selectbox(label="Select Emotion Sample",
options=["Angry", "Disgusted", "Fearful", "Happy", "Neutral", "Sad", "Surprised"])
if sample_img == "Angry":
st.image('./image/angry.png')
st.markdown('''
This emotion is usually characterized by feelings of anger, frustration, and dissatisfaction towards something perceived as threatening or hurtful.
**Physical Signs:**
* The outer part of the eyebrows is raised.
* The eyes are usually narrowed and sharp.
* The muscles around the mouth are tensed.
''')
elif sample_img == "Disgusted":
st.image('./image/disgusted.png')
st.markdown('''
This emotion is related to feelings of fear or being disturbed by something disliked or considered disgusting.
**Physical Signs**:
- The eyebrows are raised.
- The upper eyelids are raised.
- The nose is wrinkled.
- Usually, the mouth is slightly tense and slightly raised.
''')
elif sample_img == "Fearful":
st.image('./image/fearful.png')
st.markdown('''
This emotion involves feelings of fear or anxiety due to the presence of a threat or danger.
**Physical Signs**:
- Widened eyes
- Outer part of the eyebrows slightly lowered
- Mouth usually slightly downturned
- In this emotion, hands are often used to cover parts of the face.
''')
elif sample_img == "Happy":
st.image('./image/happy.png')
st.markdown('''
This emotion is usually characterized by feelings of joy, happiness, and contentment. Happy facial expressions include smiling, twinkling eyes, and a tendency to be open and friendly.
**Physical Signs**:
- Eyes appear sparkling
- Mouth is smiling
''')
elif sample_img == "Neutral":
st.image('./image/neutral.png')
st.markdown('''
Neutral emotion indicates the absence of strong emotions or facial expressions that do not show intense feelings.
Physical Signs in this expression are that each **facial feature appears not prominent**.
''')
elif sample_img == "Sad":
st.image('./image/sad.png')
st.markdown('''
This emotion involves feelings of sadness, disappointment, and loss.
Physical Signs:
- Eyebrows are usually furrowed.
- Eyes become downcast or droopy.
- The corners of the mouth slightly downturned.
''')
elif sample_img == "Surprised":
st.image('./image/surprised.png')
st.markdown('''
This emotion arises when someone experiences an unexpected event or receives surprising information.
Physical Signs:
- Eyebrows raise entirely.
- Eyes widen.
- Typically, the mouth opens.
''')
st.subheader("Mean (Avg.) of Image")
st.image('./image/mean.png')
st.markdown('''
By calculating the mean of image from each class, the following information is obtained:
* The most prominent expressions are **Happy and Surprised**, easily identifiable from the characteristics of the mouth.
* **Sad, Fearful, and Neutral** expressions are somewhat challenging to differentiate.
* **Angry and Disgusted** expressions appear similar due to the characteristics of the eyebrows and mouth.
''')
if __name__ == "__main__":
distribution()
|