imgutils.restore.scunet

Overview:

Restore the images using SCUNet.

../../_images/scunet_demo.plot.py.svg

This is an overall benchmark of all the SCUNet models:

../../_images/scunet_benchmark.plot.py.svg

Note

New in version v0.4.4, images with alpha channel supported.

If you use an image with alpha channel (e.g. RGBA images), it will return a RGBA image, otherwise return RGG image.

restore_with_scunet

imgutils.restore.scunet.restore_with_scunet(image: str | PathLike | bytes | bytearray | BinaryIO | Image, model: Literal['GAN', 'PSNR'] = 'GAN', tile_size: int = 128, tile_overlap: int = 16, batch_size: int = 4, silent: bool = False) Image[source]

Restore an image using the SCUNet model.

Parameters:
  • image (ImageTyping) – The input image.

  • model (SCUNetModelTyping) – The SCUNet model type (‘GAN’, ‘PSNR’). Default is ‘GAN’.

  • tile_size (int) – The size of processing tiles. Default is 128.

  • tile_overlap (int) – The overlap between tiles. Default is 16.

  • batch_size (int) – The batch size of inference. Default is 4.

  • silent (bool) – If True, the progress will not be displayed. Default is False.

Returns:

The restored image.

Return type:

Image.Image