SCUNet#
- class deepinv.models.SCUNet(in_nc=3, config=[4, 4, 4, 4, 4, 4, 4], dim=64, drop_path_rate=0.0, input_resolution=256, pretrained='download', device='cpu')[source]#
Bases:
Denoiser
SCUNet denoising network.
The Swin-Conv-UNet (SCUNet) denoising was introduced in Practical Blind Denoising via Swin-Conv-UNet and Data Synthesis.
- Parameters:
in_nc (int) – number of input channels. Default: 3.
config (list) – number of layers in each stage. Default: [4, 4, 4, 4, 4, 4, 4].
dim (int) – number of channels in each layer. Default: 64.
drop_path_rate (float) – drop path per sample rate (stochastic depth) for each layer. Default: 0.0.
input_resolution (int) – input resolution. Default: 256.
pretrained (bool) – use a pretrained network. If
pretrained=None
, the weights will be initialized at random using Pytorch’s default initialization. Ifpretrained='download'
, the weights will be downloaded from an online repository (only available for the default architecture). Finally,pretrained
can also be set as a path to the user’s own pretrained weights. Default: ‘download’. See pretrained-weights for more details.train (bool) – training or testing mode. Default: False.
device (str) – gpu or cpu. Default: ‘cpu’.
- forward(x, sigma=None, **kwargs)[source]#
Applies denoiser \(\denoiser{x}{\sigma}\).
- Parameters:
x (torch.Tensor) – noisy input.
sigma (torch.Tensor, float) – noise level.
- Returns:
(torch.Tensor) Denoised tensor.