Spaces:
Running
Running
Update app_front.py
Browse files- app_front.py +1 -4
app_front.py
CHANGED
|
@@ -6,8 +6,6 @@ from PIL import Image
|
|
| 6 |
# URL interna de la API
|
| 7 |
API_URL = "http://127.0.0.1:8000"
|
| 8 |
|
| 9 |
-
# --- FUNCIONES DE LÓGICA ---
|
| 10 |
-
|
| 11 |
def registrar_usuario(new_user, new_pass):
|
| 12 |
if not new_user or not new_pass:
|
| 13 |
return "⚠️ Por favor, rellena ambos campos."
|
|
@@ -61,7 +59,6 @@ def analizar_foto(token, imagen):
|
|
| 61 |
except Exception as e:
|
| 62 |
return f"🚨 Error: {str(e)}", None
|
| 63 |
|
| 64 |
-
# --- INTERFAZ GRADIO ---
|
| 65 |
|
| 66 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 67 |
# Estado para mantener el token de sesión activo entre pestañas
|
|
@@ -103,7 +100,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 103 |
btn_scan = gr.Button("Analizar con IA", variant="primary")
|
| 104 |
with gr.Column():
|
| 105 |
txt_output = gr.Markdown("Esperando inicio de sesión...")
|
| 106 |
-
img_output = gr.Image(
|
| 107 |
|
| 108 |
btn_scan.click(analizar_foto, [token_state, img_input], [txt_output, img_output])
|
| 109 |
|
|
|
|
| 6 |
# URL interna de la API
|
| 7 |
API_URL = "http://127.0.0.1:8000"
|
| 8 |
|
|
|
|
|
|
|
| 9 |
def registrar_usuario(new_user, new_pass):
|
| 10 |
if not new_user or not new_pass:
|
| 11 |
return "⚠️ Por favor, rellena ambos campos."
|
|
|
|
| 59 |
except Exception as e:
|
| 60 |
return f"🚨 Error: {str(e)}", None
|
| 61 |
|
|
|
|
| 62 |
|
| 63 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 64 |
# Estado para mantener el token de sesión activo entre pestañas
|
|
|
|
| 100 |
btn_scan = gr.Button("Analizar con IA", variant="primary")
|
| 101 |
with gr.Column():
|
| 102 |
txt_output = gr.Markdown("Esperando inicio de sesión...")
|
| 103 |
+
img_output = gr.Image()
|
| 104 |
|
| 105 |
btn_scan.click(analizar_foto, [token_state, img_input], [txt_output, img_output])
|
| 106 |
|