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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
+
|
| 4 |
+
# TECHSOLUT branding assets
|
| 5 |
+
TECHSOLUT_LOGO_PATH = "assets/techsolut_logo.png"
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def apply_techsolut_theme():
|
| 9 |
+
# # Hide Streamlit default footer & menu
|
| 10 |
+
# hide_streamlit_style = """
|
| 11 |
+
# <style>
|
| 12 |
+
# #MainMenu {visibility: hidden;}
|
| 13 |
+
# footer {visibility: hidden;}
|
| 14 |
+
# header {visibility: hidden;}
|
| 15 |
+
# </style>
|
| 16 |
+
# """
|
| 17 |
+
# st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 18 |
+
|
| 19 |
+
# TECHSOLUT theme CSS with animated SVG background
|
| 20 |
+
custom_css = """
|
| 21 |
+
<style>
|
| 22 |
+
html, body, [class*="css"] {
|
| 23 |
+
font-family: 'Segoe UI', sans-serif;
|
| 24 |
+
background: linear-gradient(145deg, #0F172A 0%, #1E293B 100%);
|
| 25 |
+
color: #E0F2F1;
|
| 26 |
+
overflow-x: hidden;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
body::before {
|
| 30 |
+
content: "";
|
| 31 |
+
position: fixed;
|
| 32 |
+
top: 0;
|
| 33 |
+
left: 0;
|
| 34 |
+
width: 100%;
|
| 35 |
+
height: 100%;
|
| 36 |
+
background-image: url('https://www.svgrepo.com/show/353498/ai.svg');
|
| 37 |
+
background-repeat: no-repeat;
|
| 38 |
+
background-position: right bottom;
|
| 39 |
+
background-size: 150px;
|
| 40 |
+
opacity: 0.03;
|
| 41 |
+
z-index: -1;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.block-container {
|
| 45 |
+
padding-top: 2rem;
|
| 46 |
+
padding-bottom: 2rem;
|
| 47 |
+
animation: fadeIn 1s ease-in-out;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
@keyframes fadeIn {
|
| 51 |
+
from { opacity: 0; }
|
| 52 |
+
to { opacity: 1; }
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
h1, h2, h3, h4, h5, h6 {
|
| 56 |
+
color: #34D399;
|
| 57 |
+
transition: color 0.3s ease-in-out;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.stButton>button {
|
| 61 |
+
background-color: #1E293B;
|
| 62 |
+
color: white;
|
| 63 |
+
border: 1px solid #34D399;
|
| 64 |
+
border-radius: 8px;
|
| 65 |
+
padding: 0.5rem 1.5rem;
|
| 66 |
+
transition: all 0.3s ease-in-out;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.stButton>button:hover {
|
| 70 |
+
background-color: #34D399;
|
| 71 |
+
color: black;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.stDownloadButton>button {
|
| 75 |
+
background-color: #0EA5E9;
|
| 76 |
+
color: white;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.stSidebar {
|
| 80 |
+
background-color: #1E293B;
|
| 81 |
+
animation: slideIn 1s ease-in-out;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
@keyframes slideIn {
|
| 85 |
+
from { transform: translateX(-20px); opacity: 0; }
|
| 86 |
+
to { transform: translateX(0); opacity: 1; }
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.stMarkdown a {
|
| 90 |
+
color: #38BDF8;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.stMarkdown a:hover {
|
| 94 |
+
text-decoration: underline;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
input, select, textarea {
|
| 98 |
+
border-radius: 6px;
|
| 99 |
+
border: 1px solid #334155;
|
| 100 |
+
padding: 0.4rem;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.metric-label {
|
| 104 |
+
color: #94A3B8;
|
| 105 |
+
font-size: 0.8rem;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.metric-value {
|
| 109 |
+
font-size: 1.5rem;
|
| 110 |
+
color: #10B981;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.icon {
|
| 114 |
+
margin-right: 8px;
|
| 115 |
+
}
|
| 116 |
+
</style>
|
| 117 |
+
"""
|
| 118 |
+
st.markdown(custom_css, unsafe_allow_html=True)
|
| 119 |
+
|
| 120 |
+
# Add TECHSOLUT logo & title
|
| 121 |
+
col1, col2 = st.columns([1, 8])
|
| 122 |
+
with col1:
|
| 123 |
+
try:
|
| 124 |
+
logo = Image.open(TECHSOLUT_LOGO_PATH)
|
| 125 |
+
st.image(logo, width=80)
|
| 126 |
+
except Exception:
|
| 127 |
+
st.write(":sparkles:")
|
| 128 |
+
with col2:
|
| 129 |
+
st.title("TECHSOLUT Platform - Vision par Ordinateur")
|
| 130 |
+
|
| 131 |
+
# Optional banner / call to action widget
|
| 132 |
+
st.markdown("""
|
| 133 |
+
<div style="background-color:#1E3A8A;padding:1rem;border-radius:10px;margin-top:1rem;">
|
| 134 |
+
<h4 style="color:#E0F2F1;">👋 Bienvenue sur la plateforme TECHSOLUT !</h4>
|
| 135 |
+
<p style="color:#CBD5E1;">🎯 <strong>Plateforme de Computer Vision</strong> pour l'analyse d'images et de vidéos en temps réel.</p>
|
| 136 |
+
<p style="color:#CBD5E1;">Effectuez des analyses en temps réel avec YOLO, RT-DETR, SAM2 et plus encore.<br>
|
| 137 |
+
Multi-caméras, détection d'intrusion, export PDF, et enregistrement vidéo intégrés.</p>
|
| 138 |
+
<p style="color:#CBD5E1;">⚙️ Configurez vos préférences via la barre latérale.<br>
|
| 139 |
+
📹 Multi-caméras | 🛡️ Détection d'intrusion | 📄 Export PDF | 🎬 Enregistrement vidéo</p>
|
| 140 |
+
</div>
|
| 141 |
+
""", unsafe_allow_html=True)
|
| 142 |
+
|
| 143 |
+
# Sticky footer with widgets and links
|
| 144 |
+
st.markdown("""
|
| 145 |
+
<style>
|
| 146 |
+
.footer {
|
| 147 |
+
position: fixed;
|
| 148 |
+
left: 0;
|
| 149 |
+
bottom: 0;
|
| 150 |
+
width: 100%;
|
| 151 |
+
background-color: #1E293B;
|
| 152 |
+
color: white;
|
| 153 |
+
text-align: center;
|
| 154 |
+
padding: 10px;
|
| 155 |
+
font-size: 14px;
|
| 156 |
+
z-index: 100;
|
| 157 |
+
border-top: 1px solid #334155;
|
| 158 |
+
}
|
| 159 |
+
.footer a {
|
| 160 |
+
color: #34D399;
|
| 161 |
+
text-decoration: none;
|
| 162 |
+
}
|
| 163 |
+
.footer a:hover {
|
| 164 |
+
text-decoration: underline;
|
| 165 |
+
}
|
| 166 |
+
</style>
|
| 167 |
+
<div class="footer">
|
| 168 |
+
<div>© 2025 TECHSOLUT - Développé avec ❤️ par Sylvestre Apetcho | <a href="mailto:contact@techsolut.fr">contact@techsolut.fr</a></div>
|
| 169 |
+
<div style="margin-top:5px;">
|
| 170 |
+
🌐 <a href="https://www.techsolut.fr" target="_blank">Site Web</a> |
|
| 171 |
+
📄 <a href="https://www.techsolut.fr/docs" target="_blank">Documentation</a> |
|
| 172 |
+
✉️ <a href="mailto:contact@techsolut.fr">Support</a>
|
| 173 |
+
</div>
|
| 174 |
+
<div style="margin-top:4px;color:#9CA3AF;">📦 Version 1.0 - Avril 2025</div>
|
| 175 |
+
</div>
|
| 176 |
+
""", unsafe_allow_html=True)
|
| 177 |
+
|
| 178 |
+
def techsolut_sidebar_widgets():
|
| 179 |
+
st.sidebar.markdown("---")
|
| 180 |
+
st.sidebar.header("🌐 Liens utiles")
|
| 181 |
+
st.sidebar.markdown("[TECHSOLUT Website](https://www.techsolut.fr)")
|
| 182 |
+
st.sidebar.markdown("[Documentation](https://www.techsolut.fr/docs)")
|
| 183 |
+
st.sidebar.markdown("[Contact Support](mailto:contact@techsolut.fr)")
|
| 184 |
+
st.sidebar.markdown("---")
|
| 185 |
+
st.sidebar.markdown("""
|
| 186 |
+
<small style='color:#9CA3AF;'>📦 Version 1.0 - Avril 2025</small>
|
| 187 |
+
""", unsafe_allow_html=True)
|
| 188 |
+
|
| 189 |
+
def main():
|
| 190 |
+
st.set_page_config(
|
| 191 |
+
page_title="Plateforme de Vision par Ordinateur - TECHSOLUT",
|
| 192 |
+
layout="wide"
|
| 193 |
+
)
|
| 194 |
+
|
| 195 |
+
apply_techsolut_theme()
|
| 196 |
+
techsolut_sidebar_widgets()
|
| 197 |
+
|
| 198 |
+
# Exemple de widget dynamique supplémentaire
|
| 199 |
+
st.sidebar.markdown("---")
|
| 200 |
+
st.sidebar.subheader("📊 Indicateurs en direct")
|
| 201 |
+
col1, col2 = st.sidebar.columns(2)
|
| 202 |
+
col1.metric("🎥 Caméras", "3", "+1")
|
| 203 |
+
col2.metric("⚠️ Alertes", "5", "-2")
|
| 204 |
+
|
| 205 |
+
st.sidebar.markdown("""
|
| 206 |
+
<hr style='border:1px solid #334155; margin-top: 1rem; margin-bottom: 0.5rem;'>
|
| 207 |
+
<div style='color:#9CA3AF;font-size:12px;'>Plateforme alimentée par Streamlit & YOLO</div>
|
| 208 |
+
""", unsafe_allow_html=True)
|
| 209 |
+
|
| 210 |
+
if __name__ == "__main__":
|
| 211 |
+
main()
|