Spaces:
Sleeping
Sleeping
File size: 4,696 Bytes
b33feda 725d2cb 25f0e13 b33feda d3ab27a b33feda 25f0e13 725d2cb 25f0e13 725d2cb d3ab27a 25f0e13 d3ab27a 25f0e13 725d2cb 25f0e13 d3ab27a b33feda 25f0e13 b33feda 25f0e13 d3ab27a 25f0e13 d3ab27a 25f0e13 d3ab27a 25f0e13 b33feda 25f0e13 d3ab27a 25f0e13 d3ab27a 25f0e13 d3ab27a 25f0e13 d3ab27a 25f0e13 d3ab27a 725d2cb 25f0e13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
import streamlit as st
from PIL import Image
import numpy as np
# Configuration de la page
st.set_page_config(
page_title="Mariam Anglais",
page_icon="🇬🇧",
layout="wide",
initial_sidebar_state="expanded"
)
# --- Fonctions pour effets visuels ---
def gradient_background(start_color, end_color):
"""Génère un fond dégradé."""
st.markdown(
f"""
<style>
body {{
background: linear-gradient(to right, {start_color}, {end_color});
background-size: 120% 120%;
animation: gradient 5s ease infinite;
}}
@keyframes gradient {{
0% {{ background-position: 0% 50%; }}
50% {{ background-position: 100% 50%; }}
100% {{ background-position: 0% 50%; }}
}}
</style>
""",
unsafe_allow_html=True
)
def neon_effect(text, color):
"""Ajoute un effet néon à un texte."""
return f"<span style='color: {color}; text-shadow: 0 0 5px {color};'>{text}</span>"
# --- Couleurs ---
start_color = "#0078D7" # Bleu Microsoft
end_color = "#00B294" # Vert émeraude
text_color = "#FFFFFF" # Blanc
neon_blue = "#66CCFF" # Bleu néon
# --- Appliquer le fond dégradé ---
gradient_background(start_color, end_color)
# --- CSS Personnalisé ---
st.markdown(
f"""
<style>
.stApp {{
font-family: 'Segoe UI', sans-serif;
}}
.stFileUploader {{
padding: 1.5rem;
border: 3px dashed {neon_blue};
border-radius: 1rem;
}}
.stRadio>div>label {{
font-weight: 600;
color: {text_color};
padding: 0.75rem 1.5rem;
margin-bottom: 0.5rem;
border-radius: 0.5rem;
border: 2px solid {neon_blue};
background-color: rgba(0, 0, 0, 0.2);
}}
.stRadio>div>label:hover {{
background-color: {neon_blue};
color: black;
}}
.stButton>button {{
background-color: {neon_blue};
color: black;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
font-weight: bold;
box-shadow: 0 0 10px {neon_blue};
transition: all 0.3s ease;
}}
.stButton>button:hover {{
transform: scale(1.05);
box-shadow: 0 0 15px {neon_blue};
}}
.st-bb {{
border-bottom: 3px solid {neon_blue};
}}
.st-eb, .st-ec, .st-ed, .st-ee, .st-ef, .st-eg, .st-eh, .st-ei, .st-ej {{
color: {text_color};
}}
.uploadedFiles {{
color: {neon_blue}
}}
.uploadedFile {{
color: {neon_blue};
font-weight: bold;
}}
</style>
""",
unsafe_allow_html=True
)
# --- Titre avec effet néon ---
st.title(neon_effect("✨ Mariam Anglais ✨", neon_blue))
# --- Introduction ---
st.markdown(f"<p style='color: {text_color}; font-size: 1.2rem;'>Bienvenue sur votre plateforme d'analyse d'images intelligente ! Téléchargez vos images, choisissez votre type d'analyse, et laissez la magie opérer.</p>", unsafe_allow_html=True)
# --- Colonnes ---
col1, col2 = st.columns(2)
with col1:
# --- Téléchargement d'images ---
uploaded_files = st.file_uploader("Choisissez des images", type=["jpg", "jpeg", "png"], accept_multiple_files=True)
# --- Effet sur les images téléchargées ---
if uploaded_files:
st.write(f"<p style='color: {neon_blue}; font-weight: bold; font-size: 1.1rem;'>Aperçu des images :</p>", unsafe_allow_html=True)
for uploaded_file in uploaded_files:
img = Image.open(uploaded_file)
img = np.array(img)
st.image(img, width=200, use_column_width='auto', output_format='JPEG')
with col2:
# --- Choix du type d'analyse avec effet néon ---
analysis_type = st.radio("Choisissez le type d'analyse :",
(neon_effect("🔍 Type 1", neon_blue), neon_effect("🧠 Type 2", neon_blue)))
# --- Bouton de soumission avec effet néon ---
if st.button("🚀 Soumettre"):
if uploaded_files:
st.write(f"<p style='color: {text_color};'>Type d'analyse sélectionné : {analysis_type}</p>", unsafe_allow_html=True)
with st.spinner(neon_effect("Analyse en cours...", neon_blue)):
# Insérez ici le code pour effectuer l'analyse d'image
import time
time.sleep(3)
st.success(neon_effect("✅ Analyse terminée !", neon_blue))
else:
st.warning(neon_effect("⚠️ Veuillez télécharger au moins une image.", neon_blue))
# --- Pied de page ---
st.markdown("---")
st.write(f"<p style='color: {text_color};'>© 2023 Mariam Anglais - Tous droits réservés.</p>", unsafe_allow_html=True) |