MedicalAILabo commited on
Commit
25c58fc
1 Parent(s): 022ebb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -57,5 +57,20 @@ def main(image):
57
 
58
 
59
  # Gradio
60
- iface = gr.Interface(fn=main, inputs=[gr.Image(type='pil', image_mode='L')], outputs='text')
61
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
 
59
  # Gradio
60
+ with gr.Blocks(title="Aging Biomarker from CXR",
61
+ css=".gradio-container {background:mintcream;}"
62
+ ) as demo:
63
+ gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-weight:bold; text-align:center; color:royalblue;">Aging Biomarker from CXR</div>""")
64
+
65
+ with gr.Row():
66
+ input_image = gr.Image(type="pil", image_mode="L", shape=(320, 320))
67
+ output_label=gr.Label(label="Estimated age")
68
+
69
+ send_btn = gr.Button("Inference")
70
+ send_btn.click(fn=main, inputs=input_image, outputs=output_label)
71
+
72
+ with gr.Row():
73
+ gr.Examples(['./samples/66_female_xp.png'], label='CXR: 66 years old female', inputs=input_image)
74
+ gr.Examples(['./samples/28_male_xp.png'], label='CXR: 28 years old male', inputs=input_image)
75
+
76
+ demo.launch(debug=True)