Update app.py
Browse files27 unmodified lines282930313233343536373839404142434445464748495051525327 unmodified linesother_class = CLASS_NAMES[other_index]other_confidence = score[other_index] * 100resultado_texto = (f"--- Resultado de la Clasificación ---\n"f"La imagen es: **{predicted_class.upper()}**\n"f"Confianza: {confidence:.2f}%\n"f"Probabilidad de ser {other_class}: {other_confidence:.2f}%\n"f"------------------------------------")return resultado_texto# Interfaz estética usando Blockswith gr.Blocks(theme="default") as demo:gr.Markdown("## Clasificador de Radiografías Dentales 🦷")with gr.Row():with gr.Column():rx_input = gr.Image(type="numpy", label="Sube tu RX")boton = gr.Button("Analizar")with gr.Column():resultado = gr.Textbox(label="Resultado", interactive=False)boton.click(fn=predecir, inputs=rx_input, outputs=resultado)27 unmodified lines282930313233343536373839404142434445464748495051525354555657585960616263646527 unmodified linesother_class = CLASS_NAMES[other_index]other_confidence = score[other_index] * 100# Resultado grande con estiloresultado_texto = f"""<div style='font-size:40px;text-align:center;padding:30px;border: 3px solid #4CAF50;border-radius:20px;background-color:#f0f0f0;'>Resultado: <b>{predicted_class.upper()}</b><br>Confianza: {confidence:.2f}%<br>Probabilidad {other_class}: {other_confidence:.2f}%</div>"""return resultado_texto# Interfaz Gradiowith gr.Blocks(theme="default") as demo:gr.Markdown("## Clasificador de Radiografías Dentales 🦷", elem_id="titulo")with gr.Row():with gr.Column():rx_input = gr.Image(type="numpy",label="Sube tu RX",source="upload" # Solo upload, sin webcam ni portapapeles)boton = gr.Button("Analizar")with gr.Column():resultado = gr.HTML(label="Resultado")boton.click(fn=predecir, inputs=rx_input, outputs=resultado)
app.py+23-11