Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -191,7 +191,6 @@ def run_full_onboarding(video, doc_img, full_name):
|
|
| 191 |
|
| 192 |
# --- 4. INTERFAZ GRÁFICA GUIADA (WIZARD) CON CSS CUSTOM ---
|
| 193 |
|
| 194 |
-
# Inyectamos CSS para dibujar un óvalo verde parpadeante sobre la cámara
|
| 195 |
custom_css = """
|
| 196 |
#guia_rostro {
|
| 197 |
position: relative;
|
|
@@ -206,7 +205,7 @@ custom_css = """
|
|
| 206 |
height: 300px;
|
| 207 |
border: 4px dashed #00ff00;
|
| 208 |
border-radius: 50%;
|
| 209 |
-
pointer-events: none;
|
| 210 |
z-index: 999;
|
| 211 |
display: flex;
|
| 212 |
align-items: flex-start;
|
|
@@ -226,7 +225,8 @@ custom_css = """
|
|
| 226 |
}
|
| 227 |
"""
|
| 228 |
|
| 229 |
-
|
|
|
|
| 230 |
gr.Markdown("<h1 style='text-align: center; color: #003366;'>🛡️ SafeScan: Onboarding Institucional</h1>")
|
| 231 |
|
| 232 |
with gr.Column(visible=True) as paso_1:
|
|
@@ -240,7 +240,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
| 240 |
5. ↔️ **Gira lentamente** la cabeza de lado a lado.
|
| 241 |
""")
|
| 242 |
n_in = gr.Textbox(label="Ingresa tu Nombre Completo", placeholder="Ej. Juan Carlos Albornoz")
|
| 243 |
-
# Le agregamos el elem_id="guia_rostro" para que el CSS sepa dónde dibujar el círculo
|
| 244 |
v_in = gr.Video(label="Cámara", sources=["webcam"], include_audio=False, elem_id="guia_rostro")
|
| 245 |
btn_paso1 = gr.Button("Siguiente: Escanear Cédula ➡️", variant="primary")
|
| 246 |
|
|
@@ -291,4 +290,5 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
| 291 |
btn_paso2.click(procesar_todo, inputs=[v_in, i_in, n_in], outputs=[paso_2, paso_3, out_pdf, out_json])
|
| 292 |
btn_reiniciar.click(reiniciar, outputs=[paso_1, paso_2, paso_3, n_in, v_in, i_in])
|
| 293 |
|
| 294 |
-
|
|
|
|
|
|
| 191 |
|
| 192 |
# --- 4. INTERFAZ GRÁFICA GUIADA (WIZARD) CON CSS CUSTOM ---
|
| 193 |
|
|
|
|
| 194 |
custom_css = """
|
| 195 |
#guia_rostro {
|
| 196 |
position: relative;
|
|
|
|
| 205 |
height: 300px;
|
| 206 |
border: 4px dashed #00ff00;
|
| 207 |
border-radius: 50%;
|
| 208 |
+
pointer-events: none;
|
| 209 |
z-index: 999;
|
| 210 |
display: flex;
|
| 211 |
align-items: flex-start;
|
|
|
|
| 225 |
}
|
| 226 |
"""
|
| 227 |
|
| 228 |
+
# AJUSTE PARA GRADIO 6.0: Dejamos Blocks() vacío
|
| 229 |
+
with gr.Blocks() as demo:
|
| 230 |
gr.Markdown("<h1 style='text-align: center; color: #003366;'>🛡️ SafeScan: Onboarding Institucional</h1>")
|
| 231 |
|
| 232 |
with gr.Column(visible=True) as paso_1:
|
|
|
|
| 240 |
5. ↔️ **Gira lentamente** la cabeza de lado a lado.
|
| 241 |
""")
|
| 242 |
n_in = gr.Textbox(label="Ingresa tu Nombre Completo", placeholder="Ej. Juan Carlos Albornoz")
|
|
|
|
| 243 |
v_in = gr.Video(label="Cámara", sources=["webcam"], include_audio=False, elem_id="guia_rostro")
|
| 244 |
btn_paso1 = gr.Button("Siguiente: Escanear Cédula ➡️", variant="primary")
|
| 245 |
|
|
|
|
| 290 |
btn_paso2.click(procesar_todo, inputs=[v_in, i_in, n_in], outputs=[paso_2, paso_3, out_pdf, out_json])
|
| 291 |
btn_reiniciar.click(reiniciar, outputs=[paso_1, paso_2, paso_3, n_in, v_in, i_in])
|
| 292 |
|
| 293 |
+
# AJUSTE PARA GRADIO 6.0: Pasamos theme y css a la función launch()
|
| 294 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft(), css=custom_css)
|