Skip to content

Instantly share code, notes, and snippets.

@alonlavian
Last active April 2, 2019 11:13
Show Gist options
  • Save alonlavian/c6200999f078c8e4ae0b2294ad2ef0bf to your computer and use it in GitHub Desktop.
Save alonlavian/c6200999f078c8e4ae0b2294ad2ef0bf to your computer and use it in GitHub Desktop.
example of using ImageDataGenerator for creating a binary training set
from tensorflow.keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale=1/255)
train_generator = train_datagen.flow_from_directory(
'/content/drive/My Drive/Training/',
target_size=(300, 300),
batch_size=10,
class_mode='binary')
print( train_generator.class_indices)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment