Clocksp commited on
Commit
91c3246
·
verified ·
1 Parent(s): 8cf7697

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -14
app.py CHANGED
@@ -228,14 +228,14 @@ desc = "Pipeline: UNet -> mask lungs -> two binary classifiers (Normal vs Bacter
228
  "If both classifiers fire, the stronger probability is chosen (fallback). Thresholds adjustable."
229
 
230
 
 
231
  example_samples = [
232
- ("images/NORMAL.jpeg", "NORMAL"),
233
- ("images/VIRAL.jpeg", "VIRAL"),
234
- ("images/BACT.jpeg", "BACTERIAL"),
235
  ]
236
 
237
  with gr.Blocks(title=title) as demo:
238
-
239
  gr.Markdown(f"### {title}")
240
  gr.Markdown(desc)
241
 
@@ -259,16 +259,14 @@ with gr.Blocks(title=title) as demo:
259
 
260
  gr.Markdown("### Test Samples")
261
 
262
- # Table Header
263
- with gr.Row():
264
- gr.Markdown("**Image**")
265
- gr.Markdown("**Label**")
266
-
267
- # Table Rows (Images + Labels)
268
- for img_path, label in example_samples:
269
- with gr.Row():
270
- gr.Image(img_path, width=150, show_label=False)
271
- gr.Markdown(f"<center>{label}</center>")
272
 
273
  if __name__ == "__main__":
274
  demo.launch(share=False)
 
228
  "If both classifiers fire, the stronger probability is chosen (fallback). Thresholds adjustable."
229
 
230
 
231
+ # Table data (Images embedded as HTML)
232
  example_samples = [
233
+ ['images/NORMAL.jpeg',"NORMAL"],
234
+ ['images/VIRAL.jpeg',"VIRAL"],
235
+ ['images/BACT.jpeg',"BACTERIAL"],
236
  ]
237
 
238
  with gr.Blocks(title=title) as demo:
 
239
  gr.Markdown(f"### {title}")
240
  gr.Markdown(desc)
241
 
 
259
 
260
  gr.Markdown("### Test Samples")
261
 
262
+ gr.Dataframe(
263
+ headers=["Image", "Label"],
264
+ value=example_samples,
265
+ interactive=False,
266
+ wrap=True,
267
+ row_count=(len(example_samples), "fixed"),
268
+ col_count=(2, "fixed")
269
+ )
 
 
270
 
271
  if __name__ == "__main__":
272
  demo.launch(share=False)