Skip to content

Instantly share code, notes, and snippets.

@ryanleeallred
Created April 25, 2018 16:30
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 ryanleeallred/cf3bf19ad3f2c5fb9da30f049da48fcd to your computer and use it in GitHub Desktop.
Save ryanleeallred/cf3bf19ad3f2c5fb9da30f049da48fcd to your computer and use it in GitHub Desktop.
# Rotate images by 90 degrees
datagen = ImageDataGenerator(rotation_range=90)
# fit parameters from data
datagen.fit(x_train)
# Configure batch size and retrieve one batch of images
for X_batch, y_batch in datagen.flow(x_train, y_train, batch_size=9):
# Show 9 images
for i in range(0, 9):
pyplot.subplot(330 + 1 + i)
pyplot.imshow(X_batch[i].reshape(img_rows, img_cols, 3))
# show the plot
pyplot.show()
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment