pipelinex.extras.datasets.pillow package

Submodules

pipelinex.extras.datasets.pillow.images_dataset module

class pipelinex.extras.datasets.pillow.images_dataset.ImagesLocalDataSet(path, load_args=None, save_args={'suffix': '.jpg'}, channel_first=False, reverse_color=False, version=None)[source]

Bases: pipelinex.extras.datasets.core.AbstractVersionedDataSet

Loads/saves a dict of numpy 3-D or 2-D arrays from/to a folder containing images.

Works like kedro.extras.datasets.pillow.ImageDataSet and kedro.io.PartitionedDataSet with conversion between numpy arrays and Pillow images.

__init__(path, load_args=None, save_args={'suffix': '.jpg'}, channel_first=False, reverse_color=False, version=None)[source]
Parameters:
  • path (str) – The folder path containing images

  • load_args (Optional[Dict[str, Any]]) – Args fed to https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open

  • save_args (Dict[str, Any]) –

    Args, e.g.

  • channel_first – If true, the first dimension of 3-D array is treated as channel (color) as in PyTorch. If false, the last dimension of the 3-D array is treated as channel (color) as in TensorFlow, Pillow, and OpenCV.

  • reverse_color – If true, the order of channel (color) is reversed (RGB to BGR when loading, BGR to RGB when saving). Set true to use packages such as OpenCV which uses BGR order natively.

  • version (Optional[Version]) – If specified, should be an instance of kedro.io.core.Version. If its load attribute is None, the latest version will be loaded. If its save attribute is None, save version will be autogenerated.

class pipelinex.extras.datasets.pillow.images_dataset.Np3DArrDataset(a)[source]

Bases: object

__init__(a)[source]

Initialize self. See help(type(self)) for accurate signature.

class pipelinex.extras.datasets.pillow.images_dataset.Np3DArrDatasetFromList(a, transform=None)[source]

Bases: object

__init__(a, transform=None)[source]

Initialize self. See help(type(self)) for accurate signature.

pipelinex.extras.datasets.pillow.images_dataset.load_image(load_path, load_args, as_numpy=False, channel_first=False, reverse_color=False)[source]
pipelinex.extras.datasets.pillow.images_dataset.scale(**kwargs)[source]