Update app.py
Browse files27 unmodified lines2829303132333435363738394041424344454 unmodified lines505152535455563 unmodified lines6061626364656627 unmodified linesother_class = CLASS_NAMES[other_index]other_confidence = score[other_index] * 100resultado_texto = f"""<div style='font-size:36px;text-align:center;padding:40px;height:350px;border: 3px solid #4CAF50;border-radius:25px;background-color:#f0f0f0;display:flex;flex-direction:column;justify-content:center;'><div>Resultado: <b>{predicted_class.upper()}</b></div><div>Confianza: {confidence:.2f}%</div>4 unmodified linesreturn resultado_textowith gr.Blocks(theme="default") as demo:gr.Markdown("## Clasificador RX LAB 🦷 (V.1: 529 NV- 348V) TFG MARTA")with gr.Row():with gr.Column():3 unmodified lineswith gr.Column():resultado = gr.HTML(label="Resultado")boton_analizar.click(fn=predecir, inputs=rx_input, outputs=resultado)boton_limpiar.click(lambda: (None, None), inputs=[], outputs=[rx_input, resultado])demo.launch()27 unmodified lines282930313233343536373839404142434445464748494 unmodified lines545556575859603 unmodified lines6465666727 unmodified linesother_class = CLASS_NAMES[other_index]other_confidence = score[other_index] * 100# Color según resultadocolor_texto = "#4CAF50" if predicted_class == "valido" else "#FF0000"resultado_texto = f"""<div style='font-size:36px;text-align:center;padding:40px;height:350px;border: 3px solid {color_texto};border-radius:25px;background-color:#f0f0f0;display:flex;flex-direction:column;justify-content:center;color:{color_texto};'><div>Resultado: <b>{predicted_class.upper()}</b></div><div>Confianza: {confidence:.2f}%</div>4 unmodified linesreturn resultado_textowith gr.Blocks(theme="default") as demo:gr.Markdown("## Clasificador de Radiografías Dentales 🦷")with gr.Row():with gr.Column():3 unmodified lineswith gr.Column():resultado = gr.HTML(label="Resultado")boton_analizar.click(fn=predecir, inputs=rx_input
app.py+7-6