Skip to content

Instantly share code, notes, and snippets.

Last active April 5, 2020 11:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# ImageDataGenerator rotation
datagen = ImageDataGenerator(rotation_range=30, fill_mode='nearest')
# iterator
aug_iter = datagen.flow(img, batch_size=1)
# generate samples and plot
fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(15,15))
# generate batch of images
for i in range(3):
# convert to unsigned integers
image = next(aug_iter)[0].astype('uint8')
# plot image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment