predict_collage#

from pssr.predict import predict_collage
pssr.predict.predict_collage(model: Module, dataset: Dataset, device: str = 'cpu', norm: bool = True, n_images: int = None, prefix: str = None, out_dir: str = 'preds', callbacks=None)#

Saves to file an image collage of vertically stacked instances of horizontally aligned low-resolution, PSSR upscaled, and high-resolution images in that order. If the dataset is in LR mode, the collage will not have high-resolution images. Only the center frame of each slice is displayed.

Only uses evaluation images if applicable. Set val_split=1 in dataset to use all images.

Parameters:
  • model (nn.Module) – Model to recieve low-resolution images.

  • dataset (Dataset) – Paired image dataset to load data from.

  • device (str) – Device to train model on. Default is “cpu”.

  • norm (bool) – Whether to normalize prediction image intensities to ground truth. Default is True.

  • n_images (int) – Number of images to concatenate. Set to None to use all validation images, maximum 50. Default is None.

  • prefix (str) – Prefix to append at the beginning the output file name. Default is None.

  • out_dir (str) – Directory to save collage. Default is “preds”.

  • callbacks (list[Callable]) – Callbacks after each prediction. Can optionally specify an argument for locals to be passed. Default is None.