Spaces:
Runtime error
Runtime error
add app.py
Browse files
app.py
CHANGED
@@ -106,13 +106,28 @@ with gr.Blocks(title="Spleen 3D segmentation with MONAI - ClassCat",
|
|
106 |
ex_image3 = gr.Image(value='thumbnails/val_image3.png', interactive=False, label='ex 4')
|
107 |
ex_image3.style(width=128, height=128)
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
ex_btn0.click(fn=load_image0, outputs=[sample_index, input_image, label_image])
|
110 |
ex_btn1.click(fn=load_image1, outputs=[sample_index, input_image, label_image])
|
111 |
ex_btn2.click(fn=load_image2, outputs=[sample_index, input_image, label_image])
|
112 |
ex_btn3.click(fn=load_image3, outputs=[sample_index, input_image, label_image])
|
|
|
|
|
|
|
113 |
|
114 |
gr.HTML("""<br/>""")
|
115 |
-
gr.HTML("""<h4 style="color:navy;">2. Then, click "Infer" button to predict segmentation
|
116 |
|
117 |
send_btn = gr.Button("Infer")
|
118 |
send_btn.click(fn=predict, inputs=[sample_index], outputs=[output_image])
|
|
|
106 |
ex_image3 = gr.Image(value='thumbnails/val_image3.png', interactive=False, label='ex 4')
|
107 |
ex_image3.style(width=128, height=128)
|
108 |
|
109 |
+
with gr.Column():
|
110 |
+
ex_btn4 = gr.Button("Example 5")
|
111 |
+
ex_btn4.style(full_width=False, css="width:20px;")
|
112 |
+
ex_image4 = gr.Image(value='thumbnails/val_image4.png', interactive=False, label='ex 5')
|
113 |
+
ex_image4.style(width=128, height=128)
|
114 |
+
|
115 |
+
with gr.Column():
|
116 |
+
ex_btn5 = gr.Button("Example 6")
|
117 |
+
ex_btn5.style(full_width=False, css="width:20px;")
|
118 |
+
ex_image5 = gr.Image(value='thumbnails/val_image5.png', interactive=False, label='ex 6')
|
119 |
+
ex_image5.style(width=128, height=128)
|
120 |
+
|
121 |
ex_btn0.click(fn=load_image0, outputs=[sample_index, input_image, label_image])
|
122 |
ex_btn1.click(fn=load_image1, outputs=[sample_index, input_image, label_image])
|
123 |
ex_btn2.click(fn=load_image2, outputs=[sample_index, input_image, label_image])
|
124 |
ex_btn3.click(fn=load_image3, outputs=[sample_index, input_image, label_image])
|
125 |
+
ex_btn4.click(fn=load_image4, outputs=[sample_index, input_image, label_image])
|
126 |
+
ex_btn5.click(fn=load_image5, outputs=[sample_index, input_image, label_image])
|
127 |
+
|
128 |
|
129 |
gr.HTML("""<br/>""")
|
130 |
+
gr.HTML("""<h4 style="color:navy;">2. Then, click "Infer" button to predict a segmentation image. It will take about 15 seconds (on cpu)</h4>""")
|
131 |
|
132 |
send_btn = gr.Button("Infer")
|
133 |
send_btn.click(fn=predict, inputs=[sample_index], outputs=[output_image])
|