Skip to content

Instantly share code, notes, and snippets.

@himanshurawlani
Created April 20, 2019 13:26
Show Gist options
  • Save himanshurawlani/456f0b0d854d8bf07616b8c6bf288c79 to your computer and use it in GitHub Desktop.
Save himanshurawlani/456f0b0d854d8bf07616b8c6bf288c79 to your computer and use it in GitHub Desktop.
Performing data augmentation for data downloaded using TFDS
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