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
# View image | |
img = datagen.flow(image, batch_size=1) | |
from matplotlib import pyplot | |
image = next(img)[0].astype('uint8') | |
pyplot.imshow(image) | |
pyplot.axis('off') |
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
# Rotation technique | |
datagen = ImageDataGenerator(rotation_range=50) |
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
# Horizontal flip | |
datagen = ImageDataGenerator(horizontal_flip=True) |
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
# Vertical flip | |
datagen = ImageDataGenerator(vertical_flip=True) |
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
# Zoom | |
datagen = ImageDataGenerator(zoom_range=0.5) |
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
# Width shift | |
datagen = ImageDataGenerator(width_shift_range=0.2) |
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
# Height shift | |
datagen = ImageDataGenerator(height_shift_range=0.2) |
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
# Brightness | |
datagen = ImageDataGenerator(brightness_range=[0.5, 1.5]) |
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
""" | |
=============================================== | |
Objective: 5 different ways for data augmentation with kera | |
Author: Niteesha.Balla | |
Blog: https://dataaspirant.com | |
Date: 2020-08-30 | |
=============================================== | |
""" |
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
# Implementation of lower case conversion | |
def lower_case_convertion(text): | |
""" | |
Input :- string | |
Output :- lowercase string | |
""" | |
lower_text = text.lower() | |
return lower_text |