Skip to content

Instantly share code, notes, and snippets.

@shgidi
Last active May 7, 2017 12:22
Show Gist options
  • Save shgidi/b1edcffb0fdf4859015ef48228f549da to your computer and use it in GitHub Desktop.
Save shgidi/b1edcffb0fdf4859015ef48228f549da to your computer and use it in GitHub Desktop.
#genertor
train_datagen = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True) #many other augmentations are avialbile
#flow
datagen.flow(x, batch_size=1, save_to_dir='preview', save_prefix='cat', save_format='jpeg')
#flow from directory
datagen.flow_from_directory( '/mnt/kaggle_crevical/train/', target_size=(150, 150),batch_size=batch_size,class_mode='binary')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment