Skip to content

Commit

Permalink
revert scale range for training
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Sep 14, 2024
1 parent c7d093b commit 10d3554
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cellpose/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def resize_image(img0, Ly=None, Lx=None, rsz=None, interpolation=cv2.INTER_LINEA
imgs = np.zeros((img0.shape[0], Ly, Lx, img0.shape[-1]), np.float32)
for i, img in enumerate(img0):
imgi = resize_safe(img, Ly, Lx, interpolation=interpolation)
imgs[i] = imgi if imgi.ndim > 2 else imgi[..., np.newaxis]
imgs[i] = imgi if imgi.ndim > 2 or no_channels else imgi[..., np.newaxis]
else:
imgs = resize_safe(img0, Ly, Lx, interpolation=interpolation)
return imgs
Expand Down Expand Up @@ -912,7 +912,7 @@ def random_rotate_and_resize(X, Y=None, scale_range=1., xy=(224, 224), do_3D=Fal
# generate random augmentation parameters
flip = np.random.rand() > .5
theta = np.random.rand() * np.pi * 2 if rotate else 0.
scale[n] = 2 ** (-2 + 5 * np.random.rand())#(1 - scale_range / 2) + scale_range * np.random.rand()
scale[n] = (1 - scale_range / 2) + scale_range * np.random.rand()
if rescale is not None:
scale[n] *= 1. / rescale[n]
dxy = np.maximum(0, np.array([Lx * scale[n] - xy[1],
Expand Down

0 comments on commit 10d3554

Please sign in to comment.