Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,81 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
for uploaded_file in uploaded_files:
|
14 |
-
st.image(uploaded_file)
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Configuration de la page
|
4 |
+
st.set_page_config(
|
5 |
+
page_title="Mariam Anglais",
|
6 |
+
page_icon="🇬🇧",
|
7 |
+
layout="wide",
|
8 |
+
initial_sidebar_state="expanded"
|
9 |
+
)
|
10 |
|
11 |
+
# CSS personnalisé pour un design plus esthétique
|
12 |
+
st.markdown(
|
13 |
+
"""
|
14 |
+
<style>
|
15 |
+
body {
|
16 |
+
background-color: #f4f4f4;
|
17 |
+
font-family: 'Arial', sans-serif;
|
18 |
+
}
|
19 |
+
.stButton>button {
|
20 |
+
background-color: #4CAF50;
|
21 |
+
color: white;
|
22 |
+
padding: 0.75rem 1.5rem;
|
23 |
+
border-radius: 0.5rem;
|
24 |
+
font-weight: bold;
|
25 |
+
}
|
26 |
+
.stFileUploader {
|
27 |
+
padding: 1rem;
|
28 |
+
border: 2px dashed #4CAF50;
|
29 |
+
border-radius: 0.5rem;
|
30 |
+
}
|
31 |
+
.stRadio>div>label {
|
32 |
+
font-weight: bold;
|
33 |
+
}
|
34 |
+
.st-bb {
|
35 |
+
border-bottom: 2px solid #4CAF50;
|
36 |
+
}
|
37 |
+
</style>
|
38 |
+
""",
|
39 |
+
unsafe_allow_html=True
|
40 |
+
)
|
41 |
|
42 |
+
# Titre et introduction
|
43 |
+
st.title("✨ Mariam Anglais ✨")
|
44 |
+
st.markdown("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.")
|
45 |
|
46 |
+
# Colonnes pour une meilleure disposition
|
47 |
+
col1, col2 = st.columns(2)
|
48 |
+
|
49 |
+
with col1:
|
50 |
+
# Téléchargement d'images
|
51 |
+
uploaded_files = st.file_uploader("Choisissez des images", type=["jpg", "jpeg", "png"], accept_multiple_files=True)
|
52 |
+
|
53 |
+
# Aperçu des images téléchargées
|
54 |
+
if uploaded_files:
|
55 |
+
st.write("Aperçu des images :")
|
56 |
for uploaded_file in uploaded_files:
|
57 |
+
st.image(uploaded_file, width=200)
|
58 |
+
|
59 |
+
with col2:
|
60 |
+
# Choix du type d'analyse
|
61 |
+
analysis_type = st.radio("Choisissez le type d'analyse :",
|
62 |
+
("🔍 Type 1", "🧠 Type 2"))
|
63 |
+
|
64 |
+
# Bouton de soumission
|
65 |
+
if st.button("🚀 Soumettre"):
|
66 |
+
if uploaded_files:
|
67 |
+
st.write("Type d'analyse sélectionné :", analysis_type)
|
68 |
+
with st.spinner("Analyse en cours..."):
|
69 |
+
# Insérez ici le code pour effectuer l'analyse d'image
|
70 |
+
# en fonction du type d'analyse choisi.
|
71 |
+
# Simule un traitement pour l'exemple
|
72 |
+
import time
|
73 |
+
time.sleep(3)
|
74 |
+
|
75 |
+
st.success("✅ Analyse terminée !")
|
76 |
+
else:
|
77 |
+
st.warning("⚠️ Veuillez télécharger au moins une image.")
|
78 |
+
|
79 |
+
# Pied de page
|
80 |
+
st.markdown("---")
|
81 |
+
st.write("© 2023 Mariam Anglais - Tous droits réservés.")
|