Spaces:
Sleeping
Sleeping
Commit
·
32dac05
1
Parent(s):
d63e342
Segundo paso de modularización: Extraída página Home a un módulo separado
Browse files- app.py +3 -23
- utils/pages/home_page.py +35 -0
app.py
CHANGED
|
@@ -28,6 +28,8 @@ from services.face_service import FaceDetectionService
|
|
| 28 |
from services.emotion_service import EmotionService as EmotionAnalysisService
|
| 29 |
# Importar el nuevo módulo para la página About
|
| 30 |
from utils.pages.about_page import render_about_page
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Definimos funciones básicas de reemplazo para no alterar el código
|
| 33 |
def display_image_with_controls(image, caption=None, use_column_width=False, title=None, allow_zoom=False, allow_download=False):
|
|
@@ -205,29 +207,7 @@ with st.sidebar:
|
|
| 205 |
|
| 206 |
# Home page
|
| 207 |
if page == "Home":
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
st.subheader("Features")
|
| 211 |
-
col1, col2, col3 = st.columns(3)
|
| 212 |
-
|
| 213 |
-
with col1:
|
| 214 |
-
st.markdown("### 📷 Visual Analysis")
|
| 215 |
-
st.markdown("Upload images to analyze facial expressions and emotions.")
|
| 216 |
-
|
| 217 |
-
with col2:
|
| 218 |
-
st.markdown("### 📊 Emotion Tracking")
|
| 219 |
-
st.markdown("Track emotions over time with detailed analytics. (Coming soon)")
|
| 220 |
-
|
| 221 |
-
with col3:
|
| 222 |
-
st.markdown("### 🧠 AI Recommendations")
|
| 223 |
-
st.markdown("Get personalized recommendations based on your emotional state. (Coming soon)")
|
| 224 |
-
|
| 225 |
-
st.subheader("Getting Started")
|
| 226 |
-
st.markdown("""
|
| 227 |
-
1. Navigate to the **Visual Analysis** page
|
| 228 |
-
2. Upload an image containing faces
|
| 229 |
-
3. View the analysis results
|
| 230 |
-
""")
|
| 231 |
|
| 232 |
# Visual Analysis page
|
| 233 |
elif page == "Visual Analysis":
|
|
|
|
| 28 |
from services.emotion_service import EmotionService as EmotionAnalysisService
|
| 29 |
# Importar el nuevo módulo para la página About
|
| 30 |
from utils.pages.about_page import render_about_page
|
| 31 |
+
# Importar el nuevo módulo para la página Home
|
| 32 |
+
from utils.pages.home_page import render_home_page
|
| 33 |
|
| 34 |
# Definimos funciones básicas de reemplazo para no alterar el código
|
| 35 |
def display_image_with_controls(image, caption=None, use_column_width=False, title=None, allow_zoom=False, allow_download=False):
|
|
|
|
| 207 |
|
| 208 |
# Home page
|
| 209 |
if page == "Home":
|
| 210 |
+
render_home_page()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
# Visual Analysis page
|
| 213 |
elif page == "Visual Analysis":
|
utils/pages/home_page.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Módulo para la página "Home" de EmotionMirror.
|
| 3 |
+
|
| 4 |
+
Este módulo contiene la lógica para renderizar la página principal
|
| 5 |
+
que muestra una introducción y características de la aplicación.
|
| 6 |
+
"""
|
| 7 |
+
import streamlit as st
|
| 8 |
+
|
| 9 |
+
def render_home_page():
|
| 10 |
+
"""
|
| 11 |
+
Renderiza la página "Home" con información general de la aplicación.
|
| 12 |
+
"""
|
| 13 |
+
st.header("EmotionMirror - Emotional Analysis System")
|
| 14 |
+
|
| 15 |
+
st.subheader("Features")
|
| 16 |
+
col1, col2, col3 = st.columns(3)
|
| 17 |
+
|
| 18 |
+
with col1:
|
| 19 |
+
st.markdown("### 📷 Visual Analysis")
|
| 20 |
+
st.markdown("Upload images to analyze facial expressions and emotions.")
|
| 21 |
+
|
| 22 |
+
with col2:
|
| 23 |
+
st.markdown("### 📊 Emotion Tracking")
|
| 24 |
+
st.markdown("Track emotions over time with detailed analytics. (Coming soon)")
|
| 25 |
+
|
| 26 |
+
with col3:
|
| 27 |
+
st.markdown("### 🧠 AI Recommendations")
|
| 28 |
+
st.markdown("Get personalized recommendations based on your emotional state. (Coming soon)")
|
| 29 |
+
|
| 30 |
+
st.subheader("Getting Started")
|
| 31 |
+
st.markdown("""
|
| 32 |
+
1. Navigate to the **Visual Analysis** page
|
| 33 |
+
2. Upload an image containing faces
|
| 34 |
+
3. View the analysis results
|
| 35 |
+
""")
|