ResUNet#

ResUNet derived from Zhang et al., 2017. ResUNet-a derived from Diakogiannis et al., 2020.

from pssr.models import ResUNet
pssr.models.ResUNet.__init__(self, channels: list[int] = 1, hidden: list[int] = [64, 128, 256, 512, 1024], scale: int = 4, depth: int = 3, dilations: list[list[int]] = None, pool_sizes: list[int] = None, encoder_pool: bool = False)#

A Residual UNet as detailed in Zhang et al., 2017 with an additional image upscaling block. If dilations is provided, instead use a Atrous Residual UNet as detailed in Diakogiannis et al., 2019.

Channel sizes hidden[0] (and hidden[-1] if encoder_pool is True) must be divisible by pool_sizes if provided.

Parameters:
  • channels (list[int]) – Number of channels in image data. Can also be a list of in channels (low-resolution) and out channels (high-resolution) respectively.

  • hidden (list[int]) – Elementwise list of channels per residual block controlling width and length of model.

  • scale (int) – Upscaling factor for predictions. Choose a power of 2 for best results. Default is 4.

  • depth (int) – Number of hidden layers per residual block. Default is 3.

  • dilations (list[list[int]]) – List of dilation values per layer. If value is None, atrous convolutions will not be used. Default is None.

  • pool_sizes (list[int]) – Pooling ratios for PSP pooling. If value is None, PSP pooling will not be used. Default is None.

  • encoder_pool (bool) – Whether to include additional PSP pooling layer at end of encoder. Should not be used if last layer has a size of less than 16 pixels. Default is False.


from pssr.models import ResUNetA
pssr.models.ResUNetA.__new__(cls, channels: int = 1, hidden: list[int] = [64, 128, 256, 512, 1024], scale: int = 4, depth: int = 3, dilations: list[list[int]] = [[1, 3, 15, 31], [1, 3, 15], [1, 3], [1], [1]], pool_sizes: list[int] = [1, 2, 4, 8], encoder_pool: bool = False)#

ResUNet wrapper of Atrous Residual UNet as detailed in Diakogiannis et al., 2019. Provides alternative default arguments for an atrous network.

Channel sizes hidden[0] (and hidden[-1] if encoder_pool is True) must be divisible by pool_sizes.

Parameters:
  • channels (int) – Number of channels in image data. Can also be a list of in channels and out channels respectively.

  • hidden (list[int]) – Elementwise list of channels per residual block controlling width and length of model.

  • scale (int) – Upscaling factor for predictions. Choose a power of 2 for best results. Default is 4.

  • depth (int) – Number of hidden layers per residual block. Default is 3.

  • dilations (list[list[int]]) – List of dilation values per layer. If value is None, atrous convolutions will not be used. Default is [[1,3,15,31],[1,3,15],[1,3],[1],[1]].

  • pool_sizes (list[int]) – Pooling ratios for PSP pooling. If value is None, PSP pooling will not be used. Default is [1, 2, 4, 8].

  • encoder_pool (bool) – Whether to include additional PSP pooling layer at end of encoder. Should not be used if last layer has a size of less than 16 pixels. Default is False.