def data_augmentation(self, images, mode='train', flip=False,
crop=False, crop_shape=(24,24,3), whiten=False,
noise=False, noise_mean=0, noise_std=0.01):
# ????
if crop:
if mode == 'train':
images = self._image_crop(images, shape=crop_shape)
elif mode == 'test':
images = self._image_crop_test(images, shape=crop_shape)
# ????
if flip:
images = self._image_flip(images)
# ????
if whiten:
images = self._image_whitening(images)
# ????
if noise:
images = self._image_noise(images, mean=noise_mean, std=noise_std)
return images
评论列表
文章目录