Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 5, 2020 06:38
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 amankharwal/53070a760315a706169b8a3e9bf06935 to your computer and use it in GitHub Desktop.
Save amankharwal/53070a760315a706169b8a3e9bf06935 to your computer and use it in GitHub Desktop.
# Create an ImageDataGenerator and do Image Augmentation
train_datagen = ImageDataGenerator(
rescale=1. / 255,
rotation_range=40,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode='nearest'
)
validation_datagen = ImageDataGenerator(
rescale=1 / 255
)
# Keep These
print(training_images.shape)
print(testing_images.shape)
# Their output should be:
# (27455, 28, 28, 1)
# (7172, 28, 28, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment