Created
April 5, 2020 11:35
-
-
Save aniruddha27/a0abde3625075fe5a153a882be6fabc7 to your computer and use it in GitHub Desktop.
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
# ImageDataGenerator shifting | |
datagen = ImageDataGenerator(width_shift_range=0.2, height_shift_range=0.2) | |
# iterator | |
aug_iter = datagen.flow(img, batch_size=1) | |
# generate samples and plot | |
fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(15,15)) | |
# generate batch of images | |
for i in range(3): | |
# convert to unsigned integers | |
image = next(aug_iter)[0].astype('uint8') | |
# plot image | |
ax[i].imshow(image) | |
ax[i].axis('off') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment