for param in self.params1d]
if per_channel_i > 0.5:
input_dtype = image.dtype
image_aug = image.astype(np.float64)
for c in sm.xrange(nb_channels):
samples_i_c = [sample_i[c] for sample_i in samples_i]
args = tuple([image[..., c]] + samples_i_c)
image_aug[..., c] = self.func(*args)
After Change
input_dtype = image.dtype
// TODO This was previously a cast of image to float64. Do the
// adjust_* functions return float64?
result = []
for c in sm.xrange(nb_channels):
samples_i_c = [sample_i[c] for sample_i in samples_i]
args = tuple([image[..., c]] + samples_i_c)
result.append(self.func(*args))
image_aug = np.stack(result, axis=-1)
image_aug = image_aug.astype(input_dtype)
else:
// don"t use something like samples_i[...][0] here, because
// that returns python scalars and is slightly less accurate