-
-
Save DiogenesAnalytics/31f4a60eb4514d38b407cceb7c14db13 to your computer and use it in GitHub Desktop.
Pre-processing the dataset download using tfds.load()
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
def format_example(image, label): | |
image = tf.cast(image, tf.float32) | |
# Normalize the pixel values | |
image = image / 255.0 | |
# Resize the image | |
image = tf.image.resize(image, (IMG_SIZE, IMG_SIZE)) | |
return image, label | |
train = raw_train.map(format_example) | |
validation = raw_validation.map(format_example) | |
test = raw_test.map(format_example) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment