basicsr.archs.rrdbnet_arch

class basicsr.archs.rrdbnet_arch.RRDB(num_feat, num_grow_ch=32)[source]

Bases: Module

Residual in Residual Dense Block.

Used in RRDB-Net in ESRGAN.

Parameters:
  • num_feat (int) – Channel number of intermediate features.

  • num_grow_ch (int) – Channels for each growth.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class basicsr.archs.rrdbnet_arch.RRDBNet(num_in_ch, num_out_ch, scale=4, num_feat=64, num_block=23, num_grow_ch=32)[source]

Bases: Module

Networks consisting of Residual in Residual Dense Block, which is used in ESRGAN.

ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks.

We extend ESRGAN for scale x2 and scale x1. Note: This is one option for scale 1, scale 2 in RRDBNet. We first employ the pixel-unshuffle (an inverse operation of pixelshuffle to reduce the spatial size and enlarge the channel size before feeding inputs into the main ESRGAN architecture.

Parameters:
  • num_in_ch (int) – Channel number of inputs.

  • num_out_ch (int) – Channel number of outputs.

  • num_feat (int) – Channel number of intermediate features. Default: 64

  • num_block (int) – Block number in the trunk network. Defaults: 23

  • num_grow_ch (int) – Channels for each growth. Default: 32.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class basicsr.archs.rrdbnet_arch.ResidualDenseBlock(num_feat=64, num_grow_ch=32)[source]

Bases: Module

Residual Dense Block.

Used in RRDB block in ESRGAN.

Parameters:
  • num_feat (int) – Channel number of intermediate features.

  • num_grow_ch (int) – Channels for each growth.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool