class documentation
class GFPGAN(nn.Module): (source)
Constructor: GFPGAN(out_size, num_style_feat, channel_multiplier, decoder_load_path, ...)
The GFPGAN architecture: Unet + StyleGAN2 decoder with SFT. It is the clean version without custom compiled CUDA extensions used in StyleGAN2. Ref: GFP-GAN: Towards Real-World Blind Face Restoration with Generative Facial Prior.
| Parameters | |
| out | The spatial size of outputs. |
| num | Channel number of style features. Default: 512. |
| channel | Channel multiplier for large networks of StyleGAN2. Default: 2. |
| decoder | The path to the pre-trained decoder model (usually, the StyleGAN2). Default: None. |
| fix | Whether to fix the decoder. Default: True. |
| num | Layer number of MLP style layers. Default: 8. |
| input | Whether input is latent style. Default: False. |
| different | Whether to use different latent w for different layers. Default: False. |
| narrow | The narrow ratio for channels. Default: 1. |
| sft | Whether to apply SFT on half of the input channels. Default: False. |
| Method | __init__ |
Undocumented |
| Method | forward |
Forward function for GFPGANv1Clean. |
| Class Variable | hyperparameters |
Undocumented |
| Instance Variable | condition |
Undocumented |
| Instance Variable | condition |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | different |
Undocumented |
| Instance Variable | final |
Undocumented |
| Instance Variable | final |
Undocumented |
| Instance Variable | input |
Undocumented |
| Instance Variable | log |
Undocumented |
| Instance Variable | num |
Undocumented |
| Instance Variable | stylegan |
Undocumented |
| Instance Variable | to |
Undocumented |
def __init__(self, *, out_size=512, num_style_feat=512, channel_multiplier=2, decoder_load_path=None, fix_decoder=False, num_mlp=8, input_is_latent=True, different_w=True, narrow=1, sft_half=True):
(source)
¶
Undocumented
def forward(self, x, return_latents=False, return_rgb=True, randomize_noise=True, **kwargs):
(source)
¶
Forward function for GFPGANv1Clean.
| Parameters | |
x:Tensor | Input images. |
returnbool | Whether to return style latents. Default: False. |
returnbool | Whether return intermediate rgb images. Default: True. |
randomizebool | Randomize noise, used when 'noise' is False. Default: True. |
| **kwargs | Undocumented |