TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Module: tf.compat.v1.keras.preprocessing.image

Set of tools for real-time data augmentation on image data.

Classes

class DirectoryIterator: Iterator capable of reading images from a directory on disk.

class ImageDataGenerator: Generate batches of tensor image data with real-time data augmentation.

class Iterator: Base class for image data iterators.

class NumpyArrayIterator: Iterator yielding data from a Numpy array.

Functions

apply_affine_transform(...): Applies an affine transformation specified by the parameters given.

apply_brightness_shift(...): Performs a brightness shift.

apply_channel_shift(...): Performs a channel shift.

array_to_img(...): Converts a 3D Numpy array to a PIL Image instance.

img_to_array(...): Converts a PIL Image instance to a Numpy array.

load_img(...): Loads an image into PIL format.

random_brightness(...): Performs a random brightness shift.

random_channel_shift(...): Performs a random channel shift.

random_rotation(...): Performs a random rotation of a Numpy image tensor.

random_shear(...): Performs a random spatial shear of a Numpy image tensor.

random_shift(...): Performs a random spatial shift of a Numpy image tensor.

random_zoom(...): Performs a random spatial zoom of a Numpy image tensor.

save_img(...): Saves an image stored as a Numpy array to a path or file object.