[source]

ImageDataGenerator

pyjet.preprocessing.image.ImageDataGenerator(generator, labels=True, augment_masks=True, samplewise_center=False, samplewise_std_normalization=False, rotation_range=0.0, width_shift_range=0.0, height_shift_range=0.0, shear_range=0.0, zoom_range=0.0, channel_shift_range=0.0, fill_mode='nearest', cval=0.0, horizontal_flip=False, vertical_flip=False, rescale=None, preprocessing_function=None, seed=None, data_format='channels_last')

Generate minibatches of image data with real-time data augmentation. Arguments

  • samplewise_center: set each sample mean to 0.
  • samplewise_std_normalization: divide each input by its std.
  • rotation_range: degrees (0 to 180).
  • width_shift_range: fraction of total width.
  • height_shift_range: fraction of total height.
  • shear_range: shear intensity (shear angle in radians).
  • zoom_range: amount of zoom. if scalar z, zoom will be randomly picked in the range [1-z, 1+z]. A sequence of two can be passed instead to select this range.
  • channel_shift_range: shift range for each channels.
  • fill_mode: points outside the boundaries are filled according to the given mode ('constant', 'nearest', 'reflect' or 'wrap'). Default is 'nearest'.
  • cval: value used for points outside the boundaries when fill_mode is 'constant'. Default is 0.
  • horizontal_flip: whether to randomly flip images horizontally.
  • vertical_flip: whether to randomly flip images vertically.
  • rescale: rescaling factor. If None or 0, no rescaling is applied, otherwise we multiply the data by the value provided. This is applied after the preprocessing_function (if any provided) but before any other transformation.
  • preprocessing_function: function that will be implied on each input. The function will run before any other modification on it. The function should take one argument: one image (Numpy tensor with rank 3), and should output a Numpy tensor with the same shape.
  • data_format: 'channels_first' or 'channels_last'. In 'channels_first' mode, the channels dimension (the depth) is at index 1, in 'channels_last' mode it is at index 3. It defaults to "channels_last".

standardize

standardize(self, x)

Apply the normalization configuration to a batch of inputs. Arguments

  • x: batch of inputs to be normalized. Returns

The inputs, normalized.


random_transform

random_transform(self, x, seed=None)

Randomly augment a single image tensor. Arguments

  • x: 3D tensor, single image.
  • seed: random seed. Returns

A randomly transformed version of the input (same shape).