Skip to content

Instantly share code, notes, and snippets.

View saimadhu-polamuri's full-sized avatar
💭
For the love of data.

saimadhu saimadhu-polamuri

💭
For the love of data.
View GitHub Profile
# 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')
# Rotation technique
datagen = ImageDataGenerator(rotation_range=50)
# Horizontal flip
datagen = ImageDataGenerator(horizontal_flip=True)
# Vertical flip
datagen = ImageDataGenerator(vertical_flip=True)
# Zoom
datagen = ImageDataGenerator(zoom_range=0.5)
# Width shift
datagen = ImageDataGenerator(width_shift_range=0.2)
# Height shift
datagen = ImageDataGenerator(height_shift_range=0.2)
# Brightness
datagen = ImageDataGenerator(brightness_range=[0.5, 1.5])
"""
===============================================
Objective: 5 different ways for data augmentation with kera
Author: Niteesha.Balla
Blog: https://dataaspirant.com
Date: 2020-08-30
===============================================
"""
# Implementation of lower case conversion
def lower_case_convertion(text):
"""
Input :- string
Output :- lowercase string
"""
lower_text = text.lower()
return lower_text