direct.nn.didn package#
Submodules#
direct.nn.didn.didn module#
- class direct.nn.didn.didn.Subpixel(in_channels, out_channels, upscale_factor, kernel_size, padding=0)[source]#
Bases:
ModuleSubpixel convolution layer for up-scaling of low resolution features at super-resolution as implemented in [1]_.
References:
- __init__(in_channels, out_channels, upscale_factor, kernel_size, padding=0)[source]#
Inits
Subpixel.- Parameters:
in_channels (
int) – Number of input channels.out_channels (
int) – Number of output channels.upscale_factor (
int) – Subpixel upscale factor.kernel_size (
Union[int,Tuple[int,int]]) – Convolution kernel size.padding (
int) – Padding size. Default:0.
- class direct.nn.didn.didn.ReconBlock(in_channels, num_convs)[source]#
Bases:
ModuleReconstruction Block of
DIDNmodel as implemented in [1]_.References:
[1] Yu, Songhyun, et al. “Deep Iterative Down-Up CNN for Image Denoising.” 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2019, pp. 2095–103. IEEE Xplore, https://doi.org/10.1109/CVPRW.2019.00262.
- __init__(in_channels, num_convs)[source]#
Inits
ReconBlock.- Parameters:
in_channels (
int) – Number of input channels.num_convs (
int) – Number of convolution blocks.
- class direct.nn.didn.didn.DUB(in_channels, out_channels)[source]#
Bases:
ModuleDown-up block (DUB) for
DIDNmodel as implemented in [1]_.References:
[1] Yu, Songhyun, et al. “Deep Iterative Down-Up CNN for Image Denoising.” 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2019, pp. 2095–103. IEEE Xplore, https://doi.org/10.1109/CVPRW.2019.00262.
- __init__(in_channels, out_channels)[source]#
Inits
DUB.- Parameters:
in_channels (
int) – intchannels. (Number of output)
out_channels (
int) – intchannels.
- static pad(x)[source]#
Pads input to height and width dimensions if odd.
- Parameters:
x (
Tensor) – torch.Tensorpad. (Input to)
- Returns:
torch.Tensor Padded tensor.
- Return type:
x
- class direct.nn.didn.didn.DIDN(in_channels, out_channels, hidden_channels=128, num_dubs=6, num_convs_recon=9, skip_connection=False)[source]#
Bases:
ModuleDeep Iterative Down-up convolutional Neural network (DIDN) implementation as in [1]_.
References:
[1] Yu, Songhyun, et al. “Deep Iterative Down-Up CNN for Image Denoising.” 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2019, pp. 2095–103. IEEE Xplore, https://doi.org/10.1109/CVPRW.2019.00262.
- __init__(in_channels, out_channels, hidden_channels=128, num_dubs=6, num_convs_recon=9, skip_connection=False)[source]#
Inits
DIDN.- Parameters:
in_channels (
int) – intchannels. (Number of output)
out_channels (
int) – intchannels.
hidden_channels (
int) – intDefault (Use skip connection.) –
num_dubs (
int) – intDefault –
num_convs_recon (
int) – intDefault –
skip_connection (
bool) – boolDefault – False.