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:
kedro.io.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
andkedro.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 imagesload_args (
Optional
[Dict
[str
,Any
]]) – Args fed to https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.opensave_args (
Dict
[str
,Any
]) –Args, e.g.
suffix: file suffix such as “.jpg”
- upper: optionally used as the upper pixel value corresponding to 0xFF (255)
for linear scaling to ensure the pixel value is between 0 and 255.
- lower: optionally used as the lower pixel value corresponding to 0x00 (0)
for linear scaling to ensure the pixel value is between 0 and 255.
- Any other args fed to
https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save
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 ofkedro.io.core.Version
. If itsload
attribute is None, the latest version will be loaded. If itssave
attribute is None, save version will be autogenerated.
-
-
class
pipelinex.extras.datasets.pillow.images_dataset.
Np3DArrDatasetFromList
(a, transform=None)[source]¶ Bases:
object