Update app.py
Browse files
app.py
CHANGED
|
@@ -237,6 +237,20 @@ with gr.Blocks(title=title) as demo:
|
|
| 237 |
thresh_b = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Bacterial threshold")
|
| 238 |
thresh_v = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Viral threshold")
|
| 239 |
seg_thresh = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Segmentation mask threshold")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
|
| 241 |
with gr.Column():
|
| 242 |
pred_out = gr.Label(num_top_classes=1, label="Prediction")
|
|
|
|
| 237 |
thresh_b = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Bacterial threshold")
|
| 238 |
thresh_v = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Viral threshold")
|
| 239 |
seg_thresh = gr.Slider(0.1, 0.9, 0.5, step=0.01, label="Segmentation mask threshold")
|
| 240 |
+
|
| 241 |
+
submit_btn = gr.Button("Submit", variant="primary")
|
| 242 |
+
clear_btn = gr.Button("Clear", variant="secondary")
|
| 243 |
+
|
| 244 |
+
submit_btn.click(
|
| 245 |
+
inference_pipeline,
|
| 246 |
+
inputs=[img_in, thresh_b, thresh_v, seg_thresh],
|
| 247 |
+
outputs=[pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 248 |
+
)
|
| 249 |
+
|
| 250 |
+
clear_btn.click(
|
| 251 |
+
lambda: (None, None, None, None, None, None),
|
| 252 |
+
outputs=[img_in, pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 253 |
+
)
|
| 254 |
|
| 255 |
with gr.Column():
|
| 256 |
pred_out = gr.Label(num_top_classes=1, label="Prediction")
|