Shortcuts

mmagic.models.editors.stylegan1.stylegan1_discriminator

Module Contents

Classes

StyleGAN1Discriminator

StyleGAN1 Discriminator.

class mmagic.models.editors.stylegan1.stylegan1_discriminator.StyleGAN1Discriminator(in_size, blur_kernel=[1, 2, 1], mbstd_cfg=dict(group_size=4))[source]

Bases: mmengine.model.BaseModule

StyleGAN1 Discriminator.

The architecture of this discriminator is proposed in StyleGAN1. More details can be found in: A Style-Based Generator Architecture for Generative Adversarial Networks CVPR2019.

Parameters
  • in_size (int) – The input size of images.

  • blur_kernel (list, optional) – The blurry kernel. Defaults to [1, 2, 1].

  • mbstd_cfg (dict, optional) – Configs for minibatch-stddev layer. Defaults to dict(group_size=4).

forward(input, transition_weight=1.0, curr_scale=- 1)[source]

Forward function.

Parameters
  • input (torch.Tensor) – Input image tensor.

  • transition_weight (float, optional) – The weight used in resolution transition. Defaults to 1..

  • curr_scale (int, optional) – The resolution scale of image tensor. -1 means the max resolution scale of the StyleGAN1. Defaults to -1.

Returns

Predict score for the input image.

Return type

torch.Tensor

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.