Update app.py
Browse files
app.py
CHANGED
|
@@ -253,22 +253,53 @@ with gr.Blocks(title=title) as demo:
|
|
| 253 |
|
| 254 |
gr.Markdown("## Test Samples")
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
with gr.Row():
|
| 257 |
|
| 258 |
-
# NORMAL
|
| 259 |
with gr.Column(scale=1):
|
| 260 |
gr.Markdown("### NORMAL")
|
| 261 |
-
gr.Image("images/NORMAL.jpeg", show_label=False, height=220)
|
| 262 |
|
| 263 |
-
# VIRAL
|
| 264 |
with gr.Column(scale=1):
|
| 265 |
gr.Markdown("### VIRAL")
|
| 266 |
-
gr.Image("images/VIRAL.jpeg", show_label=False, height=220)
|
| 267 |
|
| 268 |
-
# BACTERIAL
|
| 269 |
with gr.Column(scale=1):
|
| 270 |
gr.Markdown("### BACTERIAL")
|
| 271 |
-
gr.Image("images/BACT.jpeg", show_label=False, height=220)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
if __name__ == "__main__":
|
| 274 |
demo.launch()
|
|
|
|
| 253 |
|
| 254 |
gr.Markdown("## Test Samples")
|
| 255 |
|
| 256 |
+
# with gr.Row():
|
| 257 |
+
|
| 258 |
+
# # NORMAL
|
| 259 |
+
# with gr.Column(scale=1):
|
| 260 |
+
# gr.Markdown("### NORMAL")
|
| 261 |
+
# gr.Image("images/NORMAL.jpeg", show_label=False, height=220)
|
| 262 |
+
|
| 263 |
+
# # VIRAL
|
| 264 |
+
# with gr.Column(scale=1):
|
| 265 |
+
# gr.Markdown("### VIRAL")
|
| 266 |
+
# gr.Image("images/VIRAL.jpeg", show_label=False, height=220)
|
| 267 |
+
|
| 268 |
+
# # BACTERIAL
|
| 269 |
+
# with gr.Column(scale=1):
|
| 270 |
+
# gr.Markdown("### BACTERIAL")
|
| 271 |
+
# gr.Image("images/BACT.jpeg", show_label=False, height=220)
|
| 272 |
with gr.Row():
|
| 273 |
|
|
|
|
| 274 |
with gr.Column(scale=1):
|
| 275 |
gr.Markdown("### NORMAL")
|
| 276 |
+
normal_sample = gr.Image("images/NORMAL.jpeg", show_label=False, height=220, interactive=True)
|
| 277 |
|
|
|
|
| 278 |
with gr.Column(scale=1):
|
| 279 |
gr.Markdown("### VIRAL")
|
| 280 |
+
viral_sample = gr.Image("images/VIRAL.jpeg", show_label=False, height=220, interactive=True)
|
| 281 |
|
|
|
|
| 282 |
with gr.Column(scale=1):
|
| 283 |
gr.Markdown("### BACTERIAL")
|
| 284 |
+
bact_sample = gr.Image("images/BACT.jpeg", show_label=False, height=220, interactive=True)
|
| 285 |
+
|
| 286 |
+
normal_sample.select(
|
| 287 |
+
inference_pipeline,
|
| 288 |
+
inputs=[normal_sample, thresh_b, thresh_v, seg_thresh],
|
| 289 |
+
outputs=[pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 290 |
+
)
|
| 291 |
+
|
| 292 |
+
viral_sample.select(
|
| 293 |
+
inference_pipeline,
|
| 294 |
+
inputs=[viral_sample, thresh_b, thresh_v, seg_thresh],
|
| 295 |
+
outputs=[pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 296 |
+
)
|
| 297 |
+
|
| 298 |
+
bact_sample.select(
|
| 299 |
+
inference_pipeline,
|
| 300 |
+
inputs=[bact_sample, thresh_b, thresh_v, seg_thresh],
|
| 301 |
+
outputs=[pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 302 |
+
)
|
| 303 |
|
| 304 |
if __name__ == "__main__":
|
| 305 |
demo.launch()
|