Clocksp commited on
Commit
681f493
·
verified ·
1 Parent(s): d44c731

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -190,13 +190,13 @@ def inference_pipeline(img, thresh_b=0.5, thresh_v=0.5, seg_thresh=0.5):
190
  red_mask.putalpha(Image.fromarray(alpha))
191
  blended = Image.alpha_composite(display_orig.convert("RGBA"), red_mask)
192
  # return values
193
- return {
194
- "Prediction": label,
195
- "Bacterial Probability": float(pb),
196
- "Viral Probability": float(pv),
197
- "Masked Image": masked_pil,
198
- "Segmentation Overlay": blended
199
- }
200
 
201
  title = "Chest X-ray: UNet segmentation + 2 binary classifiers"
202
  desc = "Pipeline: UNet -> mask lungs -> two binary classifiers (Normal vs Bacterial, Normal vs Viral). " \
 
190
  red_mask.putalpha(Image.fromarray(alpha))
191
  blended = Image.alpha_composite(display_orig.convert("RGBA"), red_mask)
192
  # return values
193
+ return (
194
+ pred_label,
195
+ float(prob_bact),
196
+ float(prob_viral),
197
+ masked_image, # PIL image
198
+ overlay_image # PIL image
199
+ )
200
 
201
  title = "Chest X-ray: UNet segmentation + 2 binary classifiers"
202
  desc = "Pipeline: UNet -> mask lungs -> two binary classifiers (Normal vs Bacterial, Normal vs Viral). " \