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