Skip to content

Instantly share code, notes, and snippets.

@VedPDubey
Created July 9, 2021 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VedPDubey/40be672f3ead95919ec8d6d2a0dfc0cd to your computer and use it in GitHub Desktop.
Save VedPDubey/40be672f3ead95919ec8d6d2a0dfc0cd to your computer and use it in GitHub Desktop.
seq = iaa.Sequential([
iaa.Fliplr(0.5),
iaa.Crop(percent=(0,0.1)),
iaa.LinearContrast((0.75,1.5)),
iaa.Multiply((0.8,1.2), per_channel=0.2),
iaa.Affine(
scale={'x':(0.8,1.2), "y":(0.8,1.2)},
translate_percent={"x":(-0.2,0.2),"y":(-0.2,0.2)},
rotate=(-25,25),
shear=(-8,8)
)
], random_order=True)
(aug_images, aug_labels) = augment_add(images, seq, labels)
images = np.concatenate([images, aug_images])
labels = np.concatenate([labels, aug_labels])
images.shape, labels.shape
labels = to_categorical(labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment