AbbasAga's picture
Update app.py
714ec13 verified
import streamlit as st
# Page configuration
st.set_page_config(page_title="Sleep Tracker", layout="centered")
# Background and style
custom_css = '''
<style>
body {
background-image: url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
.stApp {
background-color: rgba(255, 255, 255, 0.88);
padding: 2rem;
border-radius: 12px;
color: #2c3e50;
font-family: 'Segoe UI', sans-serif;
}
h1, h2, h3 {
color: #2c3e50;
}
p, li {
font-size: 1.05rem;
color: #2d3436;
line-height: 1.7;
}
</style>
'''
st.markdown(custom_css, unsafe_allow_html=True)
# App Title
st.title("πŸ›Œ Sleep Detection Dashboard")
# Subtitle
st.subheader("πŸ“˜ What's This All About?")
# Problem Statement
st.markdown("""
Sleep’s a bigger deal than most give it credit for β€” and poor sleep patterns are becoming the new norm. Whether it’s inconsistent hours or mindless oversleeping, both take a toll on your mental and physical health.
This project uses wearable data β€” specifically:
- **ENMO (Euclidean Norm Minus One)**
- It measures wrist movement intensity using accelerometer data. Lower ENMO = minimal movement β†’ likely sleeping 😴
Higher ENMO = more movement β†’ likely awake 🌞
- **Angle-Z (arm angle relative to body)**
- Represents the tilt or angle of the wrist (in degrees).
A steady or low angle often suggests rest, while fluctuating angles indicate activity.
**Predicts the sleep states** like sleep onset and wake-up events, helping decode when and how a person sleeps.
---
### 🚨 Why This Matters
- πŸ‘€ **Inconsistent sleep = cognitive decline, mood issues, burnout.**
- πŸ’€ **Oversleep = red flag for health, low activity, lethargy.**
---
### 🎯 What This System Aims to Do
- πŸ”” Flag poor or erratic sleep patterns
- ⚠️ Notify about potential oversleep habits
- βœ… Celebrate consistent, healthy sleep behavior
With these insights, users (or researchers) can better understand sleep hygiene and take action β€” before burnout strikes.
---
## πŸ‘€ About Me
- Hey there! I'm Shams Abbas, the brain behind this Dashboard.
A tech enthusiast with a penchant for turning complex algorithms into user-friendly applications.
When I'm not coding, you might find me debating the best way to drink a coffee or attempting to teach my cat to code.
- *"Why did I build this app? Because your sleep schedule matters !"*
---
### πŸ”— Connect with Me
Feel free to reach out or check out my other projects:
""", unsafe_allow_html=True)
col1, col2, col3 = st.columns(3)
with col1:
st.markdown("[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?logo=linkedin)](https://www.linkedin.com/in/shams-abbas-3801a1258/)")
with col2:
st.markdown("[![GitHub](https://img.shields.io/badge/GitHub-Explore-black?logo=github)](https://github.com/shamsABBAS12)")
with col3:
st.markdown("[![Email](https://img.shields.io/badge/Email-Contact-red?logo=gmail)](mailto:abbasaga1201@gmail.com)")
# --- Footer ---
st.markdown("---")
st.markdown("<p style='text-align: center; font-size: 13px;'>βš™οΈ Built with πŸ’™ by <b>Shams Abbas</b> | Powered by Streamlit & Machine Learning</p>", unsafe_allow_html=True)