Skip to content

Commit

Permalink
fix photo2cartoon configs (PaddlePaddle#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
hao-qiang authored Jan 14, 2021
1 parent 5972bf7 commit 776fe80
Showing 1 changed file with 85 additions and 44 deletions.
129 changes: 85 additions & 44 deletions configs/ugatit_photo2cartoon.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
epochs: 300
output_dir: output_dir
adv_weight: 1.0
cycle_weight: 50.0
identity_weight: 10.0
cam_weight: 1000.0

model:
name: UGATITModel
Expand All @@ -25,57 +21,102 @@ model:
input_nc: 3
ndf: 32
n_layers: 5
l1_criterion:
name: L1Loss
mse_criterion:
name: MSELoss
bce_criterion:
name: BCEWithLogitsLoss
adv_weight: 1.0
cycle_weight: 50.0
identity_weight: 10.0
cam_weight: 1000.0

dataset:
train:
name: UnpairedDataset
dataroot: data/photo2cartoon
dataroot_a: data/photo2cartoon/trainA
dataroot_b: data/photo2cartoon/trainB
num_workers: 0
phase: train
max_dataset_size: inf
direction: AtoB
input_nc: 3
output_nc: 3
serial_batches: False
transforms:
- name: Resize
size: [286, 286]
interpolation: 'bilinear' #'bicubic' #cv2.INTER_CUBIC
- name: RandomCrop
size: [256, 256]
- name: RandomHorizontalFlip
prob: 0.5
- name: Transpose
- name: Normalize
mean: [127.5, 127.5, 127.5]
std: [127.5, 127.5, 127.5]
batch_size: 1
is_train: True
max_size: inf
preprocess:
- name: LoadImageFromFile
key: A
- name: LoadImageFromFile
key: B
- name: Transforms
input_keys: [A, B]
pipeline:
- name: Resize
size: [286, 286]
interpolation: 'bicubic' #cv2.INTER_CUBIC
keys: ['image', 'image']
- name: RandomCrop
size: [256, 256]
keys: ['image', 'image']
- name: RandomHorizontalFlip
prob: 0.5
keys: ['image', 'image']
- name: Transpose
keys: ['image', 'image']
- name: Normalize
mean: [127.5, 127.5, 127.5]
std: [127.5, 127.5, 127.5]
keys: ['image', 'image']
test:
name: SingleDataset
dataroot: data/photo2cartoon/testA
max_dataset_size: inf
direction: AtoB
input_nc: 3
output_nc: 3
serial_batches: False
transforms:
- name: Resize
size: [256, 256]
interpolation: 'bilinear' #cv2.INTER_CUBIC
- name: Transpose
- name: Normalize
mean: [127.5, 127.5, 127.5]
std: [127.5, 127.5, 127.5]

optimizer:
name: Adam
beta1: 0.5
weight_decay: 0.0001
name: UnpairedDataset
dataroot_a: data/photo2cartoon/testA
dataroot_b: data/photo2cartoon/testB
num_workers: 0
batch_size: 1
max_size: inf
is_train: False
preprocess:
- name: LoadImageFromFile
key: A
- name: LoadImageFromFile
key: B
- name: Transfroms
input_keys: [A, B]
pipeline:
- name: Resize
size: [256, 256]
interpolation: 'bicubic' #cv2.INTER_CUBIC
keys: ['image', 'image']
- name: Transpose
keys: ['image', 'image']
- name: Normalize
mean: [127.5, 127.5, 127.5]
std: [127.5, 127.5, 127.5]
keys: ['image', 'image']

lr_scheduler:
name: linear
name: LinearDecay
learning_rate: 0.0001
start_epoch: 150
decay_epochs: 150
# will get from real dataset
iters_per_epoch: 1

optimizer:
optimG:
name: Adam
net_names:
- genA2B
- genB2A
weight_decay: 0.0001
beta1: 0.5
optimD:
name: Adam
net_names:
- disGA
- disGB
- disLA
- disLB
weight_decay: 0.0001
beta1: 0.5

log_config:
interval: 10
Expand Down

0 comments on commit 776fe80

Please sign in to comment.