This file contains hidden or 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
| import cv2 | |
| import argparse | |
| # --image : Source image | |
| # --mask : Binary mask indicating pixels to be inpainted | |
| # --method : Inpainting algorithm to be used Telea/NS | |
| # --radius : Radius of neighborhood pixels to be considered for interpolation purpose | |
| a = argparse.ArgumentParser() | |
| a.add_argument("-i", "--image", type=str, required=True, help="path of image to be used") |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| datagen = ImageDataGenerator(zoom_range=[0.5,1.5]) | |
| it = datagen.flow(samples, batch_size=1) |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| datagen = ImageDataGenerator(brightness_range=[0.2,1.0]) | |
| it = datagen.flow(samples, batch_size=1) |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| datagen = ImageDataGenerator(rotation_range=360) | |
| it = datagen.flow(samples, batch_size=1) |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| # use parameter vertical_flip for vertical flip | |
| datagen = ImageDataGenerator(horizontal_flip=True) |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| datagen = ImageDataGenerator(height_shift_range=0.5) | |
| it = datagen.flow(samples, batch_size=1) |
This file contains hidden or 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
| from numpy import expand_dims | |
| from tensorflow.keras.preprocessing.image import load_img | |
| from tensorflow.keras.preprocessing.image import img_to_array | |
| from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
| import matplotlib.pyplot as plt | |
| img = load_img('golden_retriever.jpg') | |
| data = img_to_array(img) | |
| samples = expand_dims(data, 0) | |
| # create generator instance | |
| datagen = ImageDataGenerator(width_shift_range=[-0.3,0.3]) |