mouseland commited on
Commit
86aa2e7
·
verified ·
1 Parent(s): 4c3c584

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- iperm = np.random.permutation(np.max(masks.flatten()).astype('int')+1)
 
125
 
126
  overlay = Image.fromarray(overlay)
127
  flows = Image.fromarray(flows)
128
- masks = Image.fromarray(iperm[masks])
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