basicsr.archs.discriminator_arch

class basicsr.archs.discriminator_arch.UNetDiscriminatorSN(num_in_ch, num_feat=64, skip_connection=True)[source]

Bases: Module

Defines a U-Net discriminator with spectral normalization (SN)

It is used in Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data.

Arg:

num_in_ch (int): Channel number of inputs. Default: 3. num_feat (int): Channel number of base intermediate features. Default: 64. skip_connection (bool): Whether to use skip connections between U-Net. Default: True.

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.discriminator_arch.VGGStyleDiscriminator(num_in_ch, num_feat, input_size=128)[source]

Bases: Module

VGG style discriminator with input size 128 x 128 or 256 x 256.

It is used to train SRGAN, ESRGAN, and VideoGAN.

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

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

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