Spaces:
Sleeping
Sleeping
| 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("[](https://www.linkedin.com/in/shams-abbas-3801a1258/)") | |
| with col2: | |
| st.markdown("[](https://github.com/shamsABBAS12)") | |
| with col3: | |
| st.markdown("[](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) | |