Skip to content

imageloaders

imageloaders

Module for SimpleImageLoader

Classes

SimpleImageLoader

SimpleImageLoader(
    storage=None, working_dir=None, output_dtype=np.uint8
)

Bases: ImageLoader

Simple image loader that loads an image

Source code in niceml/data/dataloaders/imageloaders.py
def __init__(
    self,
    storage: Optional[StorageInterface] = None,
    working_dir: Optional[str] = None,
    output_dtype=np.uint8,
):
    self.storage = storage or LocalStorage()
    self.output_dtype = output_dtype
    self.working_dir = working_dir

SimpleImageLoaderFactory

Bases: ImageLoaderFactory

SimpleImageLoaderFactory for image files

Functions
create_image_loader
create_image_loader(storage, working_dir)

Creates an instance of ImageLoader

Source code in niceml/data/dataloaders/imageloaders.py
def create_image_loader(
    self, storage: StorageInterface, working_dir: str
) -> ImageLoader:
    """Creates an instance of ImageLoader"""
    return SimpleImageLoader(storage, working_dir)