This commit is contained in:
2020-10-22 22:42:01 +08:00
parent 0019d4034c
commit 376f5caeb7
11 changed files with 140 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
name: selfie2anime-cycleGAN
name: huawei-cycylegan-7
engine: CycleGAN
result_dir: ./result
max_pairs: 1000000
@@ -27,18 +27,33 @@ model:
out_channels: 3
base_channels: 64
num_blocks: 9
use_transpose_conv: False
pre_activation: True
# discriminator:
# _type: MultiScaleDiscriminator
# _add_spectral_norm: True
# num_scale: 2
# down_sample_method: "bilinear"
# discriminator_cfg:
# _type: PatchDiscriminator
# in_channels: 3
# base_channels: 64
# num_conv: 4
# need_intermediate_feature: True
discriminator:
_type: PatchDiscriminator
_add_spectral_norm: True
in_channels: 3
base_channels: 64
num_conv: 4
need_intermediate_feature: False
loss:
gan:
loss_type: lsgan
loss_type: hinge
weight: 1.0
real_label_val: 1.0
real_label_val: 1
fake_label_val: 0.0
cycle:
level: 1
@@ -47,17 +62,22 @@ loss:
level: 1
weight: 10.0
mgc:
weight: 5
weight: 1
fm:
weight: 0
edge:
weight: 0
hed_pretrained_model_path: ./network-bsds500.pytorch
optimizers:
generator:
_type: Adam
lr: 0.0001
lr: 1e-4
betas: [ 0.5, 0.999 ]
weight_decay: 0.0001
discriminator:
_type: Adam
lr: 1e-4
lr: 4e-4
betas: [ 0.5, 0.999 ]
weight_decay: 0.0001
@@ -75,10 +95,21 @@ data:
drop_last: True
dataset:
_type: GenerationUnpairedDataset
root_a: "/data/i2i/selfie2anime/trainA"
root_b: "/data/i2i/selfie2anime/trainB"
root_a: "/data/face2cartoon/all_face"
root_b: "/data/selfie2anime/trainB/"
random_pair: True
pipeline:
pipeline_a:
- Load
- RandomCrop:
size: [ 178, 178 ]
- Resize:
size: [ 256, 256 ]
- RandomHorizontalFlip
- ToTensor
- Normalize:
mean: [ 0.5, 0.5, 0.5 ]
std: [ 0.5, 0.5, 0.5 ]
pipeline_b:
- Load
- Resize:
size: [ 286, 286 ]
@@ -99,10 +130,18 @@ data:
drop_last: False
dataset:
_type: GenerationUnpairedDataset
root_a: "/data/i2i/selfie2anime/testA"
root_b: "/data/i2i/selfie2anime/testB"
random_pair: False
pipeline:
root_a: "/data/face2cartoon/test/human"
root_b: "/data/face2cartoon/test/anime"
random_pair: True
pipeline_a:
- Load
- Resize:
size: [ 256, 256 ]
- ToTensor
- Normalize:
mean: [ 0.5, 0.5, 0.5 ]
std: [ 0.5, 0.5, 0.5 ]
pipeline_b:
- Load
- Resize:
size: [ 256, 256 ]