reassemble_sheets#

from pssr.util import reassemble_sheets
pssr.util.reassemble_sheets(pred_path: Path, lr_path: Path, lr_scale: int, overlap: int = 0, margin: int = 0, out_dir: str = 'preds')#

Reassembles image sheets from tiled images created during prediction by sliding datasets.

Parameters:
  • pred_path (Path) – Path to predicted image tiles.

  • lr_path (Path) – Path to low-resolution image sheets.

  • lr_scale (int) – Upscaling factor of the predicted images.

  • overlap (int) – Overlap between adjacent low-resolution images tiles. Should be the same value as dataset. Default is 0.

  • margin (int) – Size of margins for overlapping inner image tiles. The generated image sheet doesn’t include margin pixels. It is recommended to increase this value to reduce grid artifacts. Must be smaller than overlap. Default is 0.

  • out_dir (str) – Directory to save images. A value of None returns images. Default is “preds”.

Returns:

Returns predicted images if out_dir is None.

Return type:

images (list[np.ndarray])