pix2pix_facades.yaml 2.2 KB
Newer Older
L
LielinJiang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
epochs: 200
output_dir: output_dir

model:
  name: Pix2PixModel
  generator:
    name: UnetGenerator
    norm_type: batch
    input_nc: 3
    output_nc: 3
    num_downs: 8 #unet256
    ngf: 64
    use_dropout: False
  discriminator:
    name: NLayerDiscriminator
    ndf: 64
    n_layers: 3
    input_nc: 6
    norm_type: batch
20 21 22 23 24 25 26
  direction: b2a
  pixel_criterion:
    name: L1Loss
    loss_weight: 100
  gan_criterion:
    name: GANLoss
    gan_mode: vanilla
L
LielinJiang 已提交
27 28 29

dataset:
  train:
30
    name: PairedDataset
31 32
    dataroot: data/facades/train
    num_workers: 4
L
LielinJiang 已提交
33
    batch_size: 1
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    preprocess:
      - name: LoadImageFromFile
        key: pair
      - name: SplitPairedImage
        key: pair
        paired_keys: [A, B]
      - name: Transforms
        input_keys: [A, B]
        pipeline:
          - name: Resize
            size: [286, 286]
            interpolation: 'bicubic' #cv2.INTER_CUBIC
            keys: [image, image]
          - name: PairedRandomCrop
            size: [256, 256]
            keys: [image, image]
          - name: PairedRandomHorizontalFlip
            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]
L
LielinJiang 已提交
59
  test:
60
    name: PairedDataset
61 62 63
    dataroot: data/facades/test
    num_workers: 4
    batch_size: 1
L
LielinJiang 已提交
64
    preprocess:
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
      - name: LoadImageFromFile
        key: pair
    - name: Transforms
        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]
L
LielinJiang 已提交
80 81

lr_scheduler:
82
  name: LinearDecay
L
LielinJiang 已提交
83 84 85
  learning_rate: 0.0002
  start_epoch: 100
  decay_epochs: 100
86 87 88 89 90 91 92 93 94 95 96 97 98 99
  # will get from real dataset
  iters_per_epoch: 1

optimizer:
  optimG:
    name: Adam
    net_names:
      - netG
    beta1: 0.5
  optimD:
    name: Adam
    net_names:
      - netD
    beta1: 0.5
L
LielinJiang 已提交
100 101 102 103 104 105 106

log_config:
  interval: 100
  visiual_interval: 500

snapshot_config:
  interval: 5