Skip to content

Instantly share code, notes, and snippets.

@agnesmm agnesmm/a1g2.py Secret
Created Sep 17, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.