osheina's picture
Update app.py
7dea483 verified
raw
history blame
4 kB
import streamlit as st
from PIL import Image
import numpy as np
# Page config
st.set_page_config(
page_title="Sign Language Project",
page_icon="πŸ€–",
layout="wide",
initial_sidebar_state="expanded"
)
# --- Custom Style ---
st.markdown("""
<style>
body {
background-size: cover;
background-attachment: fixed;
background-position: center;
font-family: 'Segoe UI', sans-serif;
color: #222;
animation: fade-in 2s ease-out;
}
.sidebar .sidebar-content {
background-color: rgba(255, 255, 255, 0.8);
padding: 1rem;
border-radius: 16px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
backdrop-filter: blur(8px);
}
.hero {
text-align: center;
padding: 5rem 2rem;
background: linear-gradient(135deg, #8e2de2, #4a00e0);
border-radius: 24px;
color: white;
margin-bottom: 3rem;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
animation: fade-in 2s ease-out;
position: relative;
}
.hero h1 {
font-size: 3.75em;
font-weight: 700;
margin-bottom: 0.3em;
animation: glow-text 2s infinite alternate;
}
.hero p {
font-size: 1.3em;
font-weight: 300;
margin-top: 0.5em;
animation: slide-in-bottom 1.2s ease-out;
}
.hero img.logo {
width: 120px;
position: absolute;
top: 20px;
left: 20px;
border-radius: 50%;
border: 2px solid white;
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.section {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
padding: 2.5rem;
margin-bottom: 2.5rem;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
backdrop-filter: blur(4px);
animation: fade-in-up 1s ease-out;
}
h3 {
font-size: 1.8rem;
color: #2e2e2e;
margin-bottom: 1rem;
}
ul, ol {
font-size: 1.1em;
line-height: 1.6;
color: #444;
}
.contact-block {
text-align: center;
padding: 3rem;
border-radius: 20px;
background: linear-gradient(to right, #ff6a00, #ee0979);
color: white;
margin-top: 3rem;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
animation: fade-in 2s ease-out;
}
.contact-block a {
color: #fff;
text-decoration: underline;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fade-in-up {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-top {
0% { transform: translateY(-100px); opacity: 0; }
100% { transform: translateY(0); opacity: 1; }
}
@keyframes slide-in-bottom {
0% { transform: translateY(100px); opacity: 0; }
100% { transform: translateY(0); opacity: 1; }
}
@keyframes glow-text {
from { text-shadow: 0 0 5px #fff, 0 0 10px #bca7ff, 0 0 20px #7e57ff; }
to { text-shadow: 0 0 10px #fff, 0 0 20px #b388ff, 0 0 30px #7e57ff; }
}
</style>
""", unsafe_allow_html=True)
# --- Hero Section ---
st.markdown("""
<div class="hero">
<img src="https://cdn-icons-png.flaticon.com/512/3062/3062634.png" class="logo" alt="logo">
<h1>Sign Language Project</h1>
<p>AI-powered Sign Language App</p>
</div>
""", unsafe_allow_html=True)
# --- Features ---
st.markdown("""
<div class="section">
<h3>✨ Key Features</h3>
<ul>
<li>⚑ Real-time AI gesture recognition</li>
<li>🧠 Optimized for Russian Sign Language</li>
<li>πŸ–₯️ Lightweight and browser-based interface</li>
<li>🌍 Promoting accessibility and inclusive communication</li>
</ul>
</div>
""", unsafe_allow_html=True)
# --- How it works ---
st.markdown("""
<div class="section">
<h3>πŸ›  How it works</h3>
<ol>
<li>Camera captures hand gestures</li>
<li>Frame is processed via ONNX deep learning model</li>
<li>Text prediction appears instantly on screen</li>
</ol>
</div>
""", unsafe_allow_html=True)
# --- Contact block ---
st.markdown("""
<div class="contact-block">
<h3>πŸ“¬ Let's collaborate!</h3>
<p>For demos, partnerships, or research opportunities:</p>
<p>Email: <a href="mailto:your@email.com">osheina9@gmail.com</a></p>
</div>
""", unsafe_allow_html=True)