dlpy.images.ImageTable.random_mutations

ImageTable.random_mutations(color_jitter=True, color_shift=True, darken=False, horizontal_flip=True, invert_pixels=False, lighten=False, pyramid_down=False, pyramid_up=False, rotate_left=False, rotate_right=False, sharpen=False, vertical_flip=True, inplace=True, random_ratio=None)

Generate random mutations from the images in the ImageTable

Parameters:
color_jitter : bool, optional

Specifies whether to apply color jittering to an input image.

color_shift : bool, optional

Specifies whether to randomly change pixel intensity values of an input image.

darken : bool, optional

Specifies whether to darken the input image.

horizontal_flip : bool, optional

Specifies whether to flip the input image horizontally.

invert_pixels : bool, optional

Specifies whether to invert all pixels in the input image.

lighten : bool, optional

Specifies whether to lighten the input image.

pyramid_down : bool, optional

Specifies whether to downsample and then blur the input image.

pyramid_up : bool, optional

Specifies whether to upsample and then blur the input image.

rotate_left : bool, optional

Specifies whether to rotate the input image to the left.

rotate_right : bool, optional

Specifies whether to rotate the input image to the right.

sharpen : bool, optional

Specifies whether to sharpen the input image.

vertical_flip : bool, optional

Specifies whether to vertically flip the input image.

inplace : bool, optional

Specifies if the input table will be used as the resulting table or not. Default : True

random_ratio : double, optional

Specifies the ratio of the randomness. The smaller value would yield less number of images in the resulting table.

Returns
——-
ImageTable

If inplace=True

None

If inplace=False

Examples

>>> from swat import CAS
>>> from dlpy.images import ImageTable
>>> s=CAS("cloud.example.com", 5570)
>>> img_tbl=ImageTable.load_files(s, "/path/to/images", caslib="CASUSER(user)")
>>> mutations = img_table.random_mutations(
...     color_jitter=True,
...     color_shift=True,
...     darken=False,
...     horizontal_flip=True,
...     invert_pixels=False,
...     lighten=False,
...     pyramid_down=False,
...     pyramid_up=False,
...     rotate_left=False,
...     rotate_right=False,
...     sharpen=False,
...     vertical_flip=True,
...     inplace=False,
...     random_ratio=None
... )
>>> mutations.show()