-
-
Save agnesmm/f6bc2775b707fbd2f62c8060948eaca3 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 | |
def get_batches(directory, target_size=target_size, batch_size=batch_size): | |
datagen = ImageDataGenerator() | |
return datagen.flow_from_directory(directory=directory, | |
target_size=target_size, | |
batch_size=batch_size, | |
class_mode='categorical') | |
batches = get_batches(path + 'train') | |
valid_batches = get_batches(path + 'valid', batch_size=batch_size*2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment