Created
January 4, 2019 08:27
-
-
Save jonathanoheix/ca479048ecfbf90634a974e298f968c2 to your computer and use it in GitHub Desktop.
This file contains 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
from keras.preprocessing.image import ImageDataGenerator | |
# number of images to feed into the NN for every batch | |
batch_size = 128 | |
datagen_train = ImageDataGenerator() | |
datagen_validation = ImageDataGenerator() | |
train_generator = datagen_train.flow_from_directory(base_path + "train", | |
target_size=(pic_size,pic_size), | |
color_mode="grayscale", | |
batch_size=batch_size, | |
class_mode='categorical', | |
shuffle=True) | |
validation_generator = datagen_validation.flow_from_directory(base_path + "validation", | |
target_size=(pic_size,pic_size), | |
color_mode="grayscale", | |
batch_size=batch_size, | |
class_mode='categorical', | |
shuffle=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment