Update app.py
Browse files
app.py
CHANGED
|
@@ -252,35 +252,24 @@ with gr.Blocks(title=title) as demo:
|
|
| 252 |
)
|
| 253 |
|
| 254 |
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
|
|
|
|
|
|
| 259 |
]
|
| 260 |
-
|
| 261 |
-
gr.
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
show_label=False,
|
| 272 |
-
height=220,
|
| 273 |
-
interactive=True
|
| 274 |
-
)
|
| 275 |
-
sample_buttons.append(btn)
|
| 276 |
-
|
| 277 |
-
# Auto-run inference when any sample is clicked
|
| 278 |
-
for btn in sample_buttons:
|
| 279 |
-
btn.change(
|
| 280 |
-
inference_pipeline,
|
| 281 |
-
inputs=[btn, thresh_b, thresh_v, seg_thresh],
|
| 282 |
-
outputs=[pred_out, pb_out, pv_out, masked_img_out, overlay_out]
|
| 283 |
-
)
|
| 284 |
|
| 285 |
|
| 286 |
if __name__ == "__main__":
|
|
|
|
| 252 |
)
|
| 253 |
|
| 254 |
|
| 255 |
+
gr.Markdown("### Example Images with Ground Truth Labels")
|
| 256 |
+
|
| 257 |
+
example_samples = [
|
| 258 |
+
["images/NORMAL.jpg", "NORMAL"],
|
| 259 |
+
["images/VIRAL.jpg", "VIRAL"],
|
| 260 |
+
["images/BACT.jpg", "BACTERIAL"],
|
| 261 |
]
|
| 262 |
+
|
| 263 |
+
gr.Dataset(
|
| 264 |
+
samples=example_samples,
|
| 265 |
+
components=[
|
| 266 |
+
gr.Image(type="filepath", label="Image", interactive=False),
|
| 267 |
+
gr.Markdown(label="True Label")
|
| 268 |
+
],
|
| 269 |
+
headers=["Image", "True Label"],
|
| 270 |
+
label="Examples Table",
|
| 271 |
+
layout="table"
|
| 272 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
|
| 275 |
if __name__ == "__main__":
|