Skip to content

Commit d4baa67

Browse files
ensure the return of _to_image is a np.array (#922)
1 parent 9ad5e30 commit d4baa67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

micro_sam/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ def _to_image(input_):
567567
else:
568568
raise ValueError(f"Invalid input image of shape {input_.shape}. Expect either 2D grayscale or 3D RGB image.")
569569

570-
return image
570+
# explicitly return a numpy array for compatibility with torchvision
571+
# because the input_ array could be something like dask array
572+
return np.array(image)
571573

572574

573575
def _compute_tiled_features_2d(predictor, input_, tile_shape, halo, f, pbar_init, pbar_update):

0 commit comments

Comments
 (0)