PairedImageDataset#

from pssr.data import PairedImageDataset
pssr.data.PairedImageDataset.__init__(self, hr_path: Path, lr_path: Path, hr_res: int = 512, lr_scale: int = 4, n_frames: list[int] = -1, extension: str = 'tif', val_split: float = 1, rotation: bool = True, split_seed: int = None, transforms: list[Module] = None)#

Testing dataset for loading paired high-low-resolution images without using crappification. Can also be used for approximating Crappifier parameters.

Parameters:
  • hr_path (Path) – Path to folder containing high-resolution images. Can also be a str.

  • lr_path (Path) – Path to folder containing low-resolution images. Can also be a str.

  • hr_res (int) – Resolution of high-resolution images. Images larger than this will be downscaled to this resolution. Images smaller will be padded. Default is 512.

  • lr_scale (int) – Downscaling factor for low-resolution images to simulate undersampling. Choose a power of 2 for best results. Default is 4.

  • n_frames (list[int]) – Amount of stacked frames per image. Can also be list of low-resolution and high-resolution stack amounts respectively. A value of -1 uses all stacked image frames. Default is -1.

  • extension (str) – File extension of images. Default is “tif”.

  • val_split (float) – Proportion of images to be held out for evaluation/prediction. Default is 1.

  • rotation (bool) – Whether to randomly rotate and/or flip images when loading data. Only applicable during training. Default is True.

  • split_seed (int) – Seed for random train/evaluation data splitting. A value of None splits the last images as evaluation. Default is None.

  • transforms (list[nn.Module]) – Additional final data transforms to apply. Default is None.