GFPGAN
1num_gpu: 1
2manual_seed: 0
3is_train: True
4dist: False
5
6# network structures
7network_g:
8type: GFPGANv1
9out_size: 512
10num_style_feat: 512
11channel_multiplier: 1
12resample_kernel: [1, 3, 3, 1]
13decoder_load_path: ~
14fix_decoder: true
15num_mlp: 8
16lr_mlp: 0.01
17input_is_latent: true
18different_w: true
19narrow: 0.5
20sft_half: true
21
22network_d:
23type: StyleGAN2Discriminator
24out_size: 512
25channel_multiplier: 1
26resample_kernel: [1, 3, 3, 1]
27
28network_d_left_eye:
29type: FacialComponentDiscriminator
30
31network_d_right_eye:
32type: FacialComponentDiscriminator
33
34network_d_mouth:
35type: FacialComponentDiscriminator
36
37network_identity:
38type: ResNetArcFace
39block: IRBlock
40layers: [2, 2, 2, 2]
41use_se: False
42
43# path
44path:
45pretrain_network_g: ~
46param_key_g: params_ema
47strict_load_g: ~
48pretrain_network_d: ~
49pretrain_network_d_left_eye: ~
50pretrain_network_d_right_eye: ~
51pretrain_network_d_mouth: ~
52pretrain_network_identity: ~
53# resume
54resume_state: ~
55ignore_resume_networks: ['network_identity']
56
57# training settings
58train:
59optim_g:
60type: Adam
61lr: !!float 2e-3
62optim_d:
63type: Adam
64lr: !!float 2e-3
65optim_component:
66type: Adam
67lr: !!float 2e-3
68
69scheduler:
70type: MultiStepLR
71milestones: [600000, 700000]
72gamma: 0.5
73
74total_iter: 800000
75warmup_iter: -1 # no warm up
76
77# losses
78# pixel loss
79pixel_opt:
80type: L1Loss
81loss_weight: !!float 1e-1
82reduction: mean
83# L1 loss used in pyramid loss, component style loss and identity loss
84L1_opt:
85type: L1Loss
86loss_weight: 1
87reduction: mean
88
89# image pyramid loss
90pyramid_loss_weight: 1
91remove_pyramid_loss: 50000
92# perceptual loss (content and style losses)
93perceptual_opt:
94type: PerceptualLoss
95layer_weights:
96# before relu
97'conv1_2': 0.1
98'conv2_2': 0.1
99'conv3_4': 1
100'conv4_4': 1
101'conv5_4': 1
102vgg_type: vgg19
103use_input_norm: true
104perceptual_weight: !!float 1
105style_weight: 50
106range_norm: true
107criterion: l1
108# gan loss
109gan_opt:
110type: GANLoss
111gan_type: wgan_softplus
112loss_weight: !!float 1e-1
113# r1 regularization for discriminator
114r1_reg_weight: 10
115# facial component loss
116gan_component_opt:
117type: GANLoss
118gan_type: vanilla
119real_label_val: 1.0
120fake_label_val: 0.0
121loss_weight: !!float 1
122comp_style_weight: 200
123# identity loss
124identity_weight: 10
125
126net_d_iters: 1
127net_d_init_iters: 0
128net_d_reg_every: 1
129
130# validation settings
131val:
132val_freq: !!float 5e3
133save_img: True
134use_pbar: True
135
136metrics:
137psnr: # metric name
138type: calculate_psnr
139crop_border: 0
140test_y_channel: false
141