Last active
December 20, 2022 11:31
-
-
Save zenUnicorn/eb6b9552369dc57aff49c0c99305b538 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
image_generator = ImageDataGenerator(rescale=1/255, validation_split=0.2) | |
#Train & Validation Split | |
train_dataset = image_generator.flow_from_directory(batch_size=32, | |
directory='data_cleaned/Train', | |
shuffle=True, | |
target_size=(224, 224), | |
subset="training", | |
class_mode='categorical') | |
validation_dataset = image_generator.flow_from_directory(batch_size=32, | |
directory='data_cleaned/Train', | |
shuffle=True, | |
target_size=(224, 224), | |
subset="validation", | |
class_mode='categorical') | |
#Organize data for our predictions | |
image_generator_prediction = ImageDataGenerator(rescale=1/255) | |
prediction_data = image_generator_prediction.flow_from_directory( | |
directory='data_cleaned/scraped_images', | |
shuffle=False, | |
target_size=(224, 224), | |
class_mode=None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment