Update app.py
Browse files
app.py
CHANGED
|
@@ -121,11 +121,12 @@ def cellpose_segment(img_input):
|
|
| 121 |
outpix = plot_outlines(img_input, masks)
|
| 122 |
overlay = plot_overlay(img_input, masks)
|
| 123 |
|
| 124 |
-
|
|
|
|
| 125 |
|
| 126 |
overlay = Image.fromarray(overlay)
|
| 127 |
flows = Image.fromarray(flows)
|
| 128 |
-
masks = Image.fromarray(
|
| 129 |
|
| 130 |
return outpix, overlay, flows, masks
|
| 131 |
|
|
|
|
| 121 |
outpix = plot_outlines(img_input, masks)
|
| 122 |
overlay = plot_overlay(img_input, masks)
|
| 123 |
|
| 124 |
+
crand = .2 + .8 * np.random.rand(np.max(masks.flatten()).astype('int')+1, 'float32')
|
| 125 |
+
crand[0] = 0
|
| 126 |
|
| 127 |
overlay = Image.fromarray(overlay)
|
| 128 |
flows = Image.fromarray(flows)
|
| 129 |
+
masks = Image.fromarray(crand[masks])
|
| 130 |
|
| 131 |
return outpix, overlay, flows, masks
|
| 132 |
|