// so we use here (half cell height/width to H/W minus half
// height/width) instead of (0, H/W)
nb_rows = max(nb_rows, 2)
nb_cols = max(nb_cols, 2)
y = np.linspace(0, augmentable_shape[0], nb_rows)
x = np.linspace(0, augmentable_shape[1], nb_cols)
After Change
// (1, HW, 2) => (HW, 2) for H=rows, W=cols
points_src = np.dstack([yy_src.flat, xx_src.flat])[0]
any_nonzero = np.any(jitter_img > 0)
if not any_nonzero:
return None
else:
// Without this, jitter gets changed between different augmentables.
// TODO if left out, only one test failed -- should be more
jitter_img = np.copy(jitter_img)
if self.absolute_scale:
if image_shape[0] > 0:
jitter_img[:, 0] = jitter_img[:, 0] / image_shape[0]