Update app.py
Browse files
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 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 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). " \
|