Skip to content

Instantly share code, notes, and snippets.

@SmiffyKMc
Created June 17, 2022 13:33
Show Gist options
  • Save SmiffyKMc/7fb6f63657b838e3bd9c6ae33eb6a724 to your computer and use it in GitHub Desktop.
Save SmiffyKMc/7fb6f63657b838e3bd9c6ae33eb6a724 to your computer and use it in GitHub Desktop.
Example of the data augmentation and views from the plot
data_augmentation = keras.Sequential(
[
layers.RandomRotation(0.3),
layers.RandomZoom(0.2),
layers.RandomFlip("horizontal"),
]
)
plt.figure(figsize=(10, 10))
for images, _ in test_dataset.take(1):
for i in range(9):
augmented_images = data_augmentation(images, training=True)
ax = plt.subplot(3, 3, i + 1)
plt.imshow(augmented_images[0].numpy().astype("uint8"))
plt.axis("off")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment