Created
July 13, 2021 16:56
-
-
Save VedPDubey/143beb54baf942a4b5535432c65c394a 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
train_dir = 'data1a/training' | |
test_dir = 'data1a/validation' | |
train_data = ImageDataGenerator(rescale = 1./255,shear_range = 0.2, zoom_range = 0.2, horizontal_flip = True) | |
#defining training set, here size of image is reduced to 150x150, batch of images is kept as 128 and class is defined as 'categorical'. | |
training_set = train_data.flow_from_directory(train_dir, batch_size = 32, target_size = (64,64), class_mode = 'categorical') | |
#applying same scale as training set, but only feature scaling is applied. image augmentation is avoided to prevent leakage of testing data. | |
test_data = ImageDataGenerator(rescale = 1./255) | |
#defining testing set | |
testing_set = test_data.flow_from_directory(test_dir, batch_size = 32, target_size = (64,64), class_mode = 'categorical') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment