Clocksp commited on
Commit
052c346
·
verified ·
1 Parent(s): 0632a76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -28
app.py CHANGED
@@ -252,35 +252,24 @@ with gr.Blocks(title=title) as demo:
252
  )
253
 
254
 
255
- test_samples = [
256
- ("images/NORMAL.jpeg", "NORMAL"),
257
- ("images/VIRAL.jpeg", "VIRAL"),
258
- ("images/BACT.jpeg", "BACTERIAL"),
 
 
259
  ]
260
-
261
- gr.Markdown("## Test Samples")
262
-
263
- sample_buttons = []
264
-
265
- with gr.Row():
266
- for img_path, label in test_samples:
267
- with gr.Column(scale=1):
268
- gr.Markdown(f"### {label}")
269
- btn = gr.Image(
270
- img_path,
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__":