Created
April 20, 2019 13:26
-
-
Save himanshurawlani/456f0b0d854d8bf07616b8c6bf288c79 to your computer and use it in GitHub Desktop.
Performing data augmentation for data downloaded using TFDS
This file contains hidden or 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 augment_data(image, label): | |
print("Augment data called!") | |
image = tf.image.random_flip_left_right(image) | |
image = tf.image.random_contrast(image, lower=0.0, upper=1.0) | |
# Add more augmentation of your choice | |
return image, label | |
train = train.map(augment_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment