pix2pix_cityscapes.yaml 2.4 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:
L
LielinJiang 已提交
30
    name: PairedDataset
31
    dataroot: data/cityscapes/train
L
LielinJiang 已提交
32
    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:
L
LielinJiang 已提交
60
    name: PairedDataset
61 62 63
    dataroot: data/cityscapes/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 80 81 82
      - name: LoadImageFromFile
        key: pair
      - name: SplitPairedImage
        key: pair
        paired_keys: [A, B]
      - 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 已提交
83 84

lr_scheduler:
85
  name: LinearDecay
L
LielinJiang 已提交
86 87 88
  learning_rate: 0.0002
  start_epoch: 100
  decay_epochs: 100
89 90 91 92 93 94 95 96 97 98 99 100 101 102
  # 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 已提交
103 104 105 106 107 108 109

log_config:
  interval: 100
  visiual_interval: 500

snapshot_config:
  interval: 5
L
lzzyzlbb 已提交
110 111 112 113 114 115 116 117 118 119

validate:
  interval: 500
  save_img: false
  metrics:
    fid: # metric name, can be arbitrary
        name: FID
        batch_size: 8