Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
| 4 |
-
import time
|
| 5 |
-
import random
|
| 6 |
|
| 7 |
# Page config
|
| 8 |
st.set_page_config(
|
| 9 |
page_title="GestureGuru",
|
| 10 |
-
page_icon="
|
| 11 |
layout="wide",
|
| 12 |
initial_sidebar_state="auto"
|
| 13 |
)
|
|
@@ -16,59 +14,57 @@ st.set_page_config(
|
|
| 16 |
st.markdown("""
|
| 17 |
<style>
|
| 18 |
body {
|
| 19 |
-
background: linear-gradient(
|
| 20 |
font-family: 'Segoe UI', sans-serif;
|
| 21 |
-
|
| 22 |
-
header {
|
| 23 |
-
visibility: hidden;
|
| 24 |
-
}
|
| 25 |
-
section.main > div {
|
| 26 |
-
padding-top: 2rem;
|
| 27 |
-
padding-bottom: 2rem;
|
| 28 |
}
|
| 29 |
.hero {
|
| 30 |
text-align: center;
|
| 31 |
-
padding:
|
| 32 |
-
background: linear-gradient(
|
| 33 |
-
border-radius:
|
| 34 |
-
box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);
|
| 35 |
color: white;
|
|
|
|
|
|
|
| 36 |
}
|
| 37 |
.hero h1 {
|
| 38 |
-
font-size: 3.
|
| 39 |
-
|
|
|
|
| 40 |
}
|
| 41 |
.hero p {
|
| 42 |
-
font-size: 1.
|
|
|
|
| 43 |
margin-top: 0.5em;
|
| 44 |
}
|
| 45 |
.section {
|
| 46 |
-
background
|
| 47 |
-
border-radius:
|
| 48 |
-
padding:
|
| 49 |
-
margin-bottom:
|
| 50 |
-
box-shadow: 0
|
| 51 |
-
transition: transform 0.3s ease;
|
| 52 |
-
}
|
| 53 |
-
.section:hover {
|
| 54 |
-
transform: translateY(-5px);
|
| 55 |
}
|
| 56 |
h3 {
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
ul, ol {
|
| 60 |
-
color: #555;
|
| 61 |
font-size: 1.1em;
|
|
|
|
| 62 |
}
|
| 63 |
-
.
|
| 64 |
text-align: center;
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
</style>
|
| 74 |
""", unsafe_allow_html=True)
|
|
@@ -76,20 +72,20 @@ ul, ol {
|
|
| 76 |
# --- Hero Section ---
|
| 77 |
st.markdown("""
|
| 78 |
<div class="hero">
|
| 79 |
-
<h1
|
| 80 |
-
<p>AI
|
| 81 |
-
<p>Enhancing communication through computer vision</p>
|
| 82 |
</div>
|
| 83 |
""", unsafe_allow_html=True)
|
| 84 |
|
| 85 |
# --- Features ---
|
| 86 |
st.markdown("""
|
| 87 |
<div class="section">
|
| 88 |
-
<h3
|
| 89 |
<ul>
|
| 90 |
-
<li
|
| 91 |
-
<li
|
| 92 |
-
<li
|
|
|
|
| 93 |
</ul>
|
| 94 |
</div>
|
| 95 |
""", unsafe_allow_html=True)
|
|
@@ -97,48 +93,24 @@ st.markdown("""
|
|
| 97 |
# --- How it works ---
|
| 98 |
st.markdown("""
|
| 99 |
<div class="section">
|
| 100 |
-
<h3
|
| 101 |
<ol>
|
| 102 |
-
<li>
|
| 103 |
-
<li>
|
| 104 |
-
<li>
|
| 105 |
</ol>
|
| 106 |
</div>
|
| 107 |
""", unsafe_allow_html=True)
|
| 108 |
|
| 109 |
-
# --- Simulated Prediction Animation ---
|
| 110 |
-
st.markdown("""
|
| 111 |
-
<div class="section">
|
| 112 |
-
<h3>π¬ Live Prediction Simulation</h3>
|
| 113 |
-
<p>Watch how GestureGuru might respond in real-time:</p>
|
| 114 |
-
""", unsafe_allow_html=True)
|
| 115 |
-
|
| 116 |
-
placeholder = st.empty()
|
| 117 |
-
progress = st.progress(0)
|
| 118 |
-
|
| 119 |
-
for i in range(100):
|
| 120 |
-
time.sleep(0.03)
|
| 121 |
-
progress.progress(i + 1)
|
| 122 |
-
|
| 123 |
-
gesture_samples = ["Hello", "Thank you", "Yes", "No", "Please", "Goodbye"]
|
| 124 |
-
selected = random.choice(gesture_samples)
|
| 125 |
-
confidence = round(random.uniform(87.0, 99.9), 1)
|
| 126 |
-
|
| 127 |
-
with placeholder.container():
|
| 128 |
-
st.markdown(f"""
|
| 129 |
-
<div class="prediction-box">
|
| 130 |
-
β
Detected gesture: <strong>{selected}</strong><br>
|
| 131 |
-
π Confidence: <strong>{confidence}%</strong>
|
| 132 |
-
</div>
|
| 133 |
-
""", unsafe_allow_html=True)
|
| 134 |
-
|
| 135 |
# --- Contact block ---
|
| 136 |
st.markdown("""
|
| 137 |
-
<div class="
|
| 138 |
-
<h3
|
| 139 |
-
<p>
|
|
|
|
| 140 |
</div>
|
| 141 |
""", unsafe_allow_html=True)
|
| 142 |
|
| 143 |
|
| 144 |
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Page config
|
| 6 |
st.set_page_config(
|
| 7 |
page_title="GestureGuru",
|
| 8 |
+
page_icon="π€",
|
| 9 |
layout="wide",
|
| 10 |
initial_sidebar_state="auto"
|
| 11 |
)
|
|
|
|
| 14 |
st.markdown("""
|
| 15 |
<style>
|
| 16 |
body {
|
| 17 |
+
background: linear-gradient(to right, #f8fbff, #eef7ff);
|
| 18 |
font-family: 'Segoe UI', sans-serif;
|
| 19 |
+
color: #333;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
.hero {
|
| 22 |
text-align: center;
|
| 23 |
+
padding: 5rem 2rem;
|
| 24 |
+
background: linear-gradient(135deg, #667eea, #764ba2);
|
| 25 |
+
border-radius: 24px;
|
|
|
|
| 26 |
color: white;
|
| 27 |
+
margin-bottom: 3rem;
|
| 28 |
+
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
|
| 29 |
}
|
| 30 |
.hero h1 {
|
| 31 |
+
font-size: 3.75em;
|
| 32 |
+
font-weight: 700;
|
| 33 |
+
margin-bottom: 0.3em;
|
| 34 |
}
|
| 35 |
.hero p {
|
| 36 |
+
font-size: 1.3em;
|
| 37 |
+
font-weight: 300;
|
| 38 |
margin-top: 0.5em;
|
| 39 |
}
|
| 40 |
.section {
|
| 41 |
+
background: white;
|
| 42 |
+
border-radius: 20px;
|
| 43 |
+
padding: 2.5rem;
|
| 44 |
+
margin-bottom: 2.5rem;
|
| 45 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
h3 {
|
| 48 |
+
font-size: 1.8rem;
|
| 49 |
+
color: #333;
|
| 50 |
+
margin-bottom: 1rem;
|
| 51 |
}
|
| 52 |
ul, ol {
|
|
|
|
| 53 |
font-size: 1.1em;
|
| 54 |
+
line-height: 1.6;
|
| 55 |
}
|
| 56 |
+
.contact-block {
|
| 57 |
text-align: center;
|
| 58 |
+
padding: 3rem;
|
| 59 |
+
border-radius: 20px;
|
| 60 |
+
background: linear-gradient(to right, #ff416c, #ff4b2b);
|
| 61 |
+
color: white;
|
| 62 |
+
margin-top: 3rem;
|
| 63 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
| 64 |
+
}
|
| 65 |
+
.contact-block a {
|
| 66 |
+
color: #fff;
|
| 67 |
+
text-decoration: underline;
|
| 68 |
}
|
| 69 |
</style>
|
| 70 |
""", unsafe_allow_html=True)
|
|
|
|
| 72 |
# --- Hero Section ---
|
| 73 |
st.markdown("""
|
| 74 |
<div class="hero">
|
| 75 |
+
<h1>GestureGuru</h1>
|
| 76 |
+
<p>AI for Sign Language Understanding & Accessibility</p>
|
|
|
|
| 77 |
</div>
|
| 78 |
""", unsafe_allow_html=True)
|
| 79 |
|
| 80 |
# --- Features ---
|
| 81 |
st.markdown("""
|
| 82 |
<div class="section">
|
| 83 |
+
<h3>β¨ Key Features</h3>
|
| 84 |
<ul>
|
| 85 |
+
<li>β‘ Real-time AI gesture recognition</li>
|
| 86 |
+
<li>π§ Optimized for Russian Sign Language</li>
|
| 87 |
+
<li>π₯οΈ Lightweight and browser-based interface</li>
|
| 88 |
+
<li>π Promoting accessibility and inclusive communication</li>
|
| 89 |
</ul>
|
| 90 |
</div>
|
| 91 |
""", unsafe_allow_html=True)
|
|
|
|
| 93 |
# --- How it works ---
|
| 94 |
st.markdown("""
|
| 95 |
<div class="section">
|
| 96 |
+
<h3>π How it works</h3>
|
| 97 |
<ol>
|
| 98 |
+
<li>Camera captures hand gestures</li>
|
| 99 |
+
<li>Frame is processed via ONNX deep learning model</li>
|
| 100 |
+
<li>Text prediction appears instantly on screen</li>
|
| 101 |
</ol>
|
| 102 |
</div>
|
| 103 |
""", unsafe_allow_html=True)
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
# --- Contact block ---
|
| 106 |
st.markdown("""
|
| 107 |
+
<div class="contact-block">
|
| 108 |
+
<h3>π¬ Let's collaborate!</h3>
|
| 109 |
+
<p>For demos, partnerships, or research opportunities:</p>
|
| 110 |
+
<p>Email: <a href="mailto:your@email.com">your@email.com</a></p>
|
| 111 |
</div>
|
| 112 |
""", unsafe_allow_html=True)
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
+
|