Skip to content

Instantly share code, notes, and snippets.

@Sachin-crypto
Created December 16, 2022 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sachin-crypto/9ac6649fbf32e30effad73f8d5888cd9 to your computer and use it in GitHub Desktop.
Save Sachin-crypto/9ac6649fbf32e30effad73f8d5888cd9 to your computer and use it in GitHub Desktop.
# Creating batches of the train, valid and test images and Pre-processing using mobilenet preprocess model
train_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.mobilenet.preprocess_input).flow_from_directory(
directory=train_path, target_size=(224,224), batch_size=10, shuffle=True)
valid_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.mobilenet.preprocess_input).flow_from_directory(
directory=valid_path, target_size=(224,224), batch_size=10, shuffle=True)
test_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.mobilenet.preprocess_input).flow_from_directory(
directory=test_path, target_size=(224,224), batch_size=10, shuffle=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment