Created
May 3, 2021 05:57
-
-
Save Kakarot-2000/56597eec3ee9e014e52139894093aac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#data augmentation | |
x_train=x_train.reshape((x_train.shape[0],48,48,1)) | |
x_test=x_test.reshape((x_test.shape[0],48,48,1)) | |
from keras.preprocessing.image import ImageDataGenerator | |
train_datagen = ImageDataGenerator(rescale=1./255, | |
rotation_range=60, | |
shear_range=0.5, | |
zoom_range=0.5, | |
width_shift_range=0.5, | |
height_shift_range=0.5, | |
horizontal_flip=True, | |
fill_mode='nearest') | |
validation_datagen = ImageDataGenerator(rescale=1./255) | |
train_datagen.fit(x_train) | |
validation_datagen.fit(x_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment