Update app.py
Browse files
app.py
CHANGED
|
@@ -193,10 +193,10 @@ def cellpose_segment(filepath, resize = 1000):
|
|
| 193 |
target_size = (img_input.shape[1], img_input.shape[0])
|
| 194 |
if (target_size[0]!=img.shape[1] or target_size[1]!=img.shape[0]):
|
| 195 |
# scale it back to keep the orignal size
|
| 196 |
-
|
| 197 |
|
| 198 |
fname_masks = os.path.splitext(filepath[j])[0]+"_masks.tif"
|
| 199 |
-
imsave(fname_masks,
|
| 200 |
|
| 201 |
myzip.write(fname_masks, arcname = os.path.split(fname_masks)[-1])
|
| 202 |
|
|
|
|
| 193 |
target_size = (img_input.shape[1], img_input.shape[0])
|
| 194 |
if (target_size[0]!=img.shape[1] or target_size[1]!=img.shape[0]):
|
| 195 |
# scale it back to keep the orignal size
|
| 196 |
+
masks_rsz = cv2.resize(masks.astype('uint16'), target_size, interpolation=cv2.INTER_NEAREST).astype('uint16')
|
| 197 |
|
| 198 |
fname_masks = os.path.splitext(filepath[j])[0]+"_masks.tif"
|
| 199 |
+
imsave(fname_masks, masks_rsz)
|
| 200 |
|
| 201 |
myzip.write(fname_masks, arcname = os.path.split(fname_masks)[-1])
|
| 202 |
|