ir18_adaface.yaml 2.0 KB
Newer Older
D
dongshuilong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# global configs
Global:
  checkpoints: null
  pretrained_model: null
  output_dir: "./output/"
  device: "gpu"
  save_interval: 1
  eval_during_train: True
  eval_interval: 1
  epochs: 26
  print_batch_step: 10
  use_visualdl: False
  # used for static mode and model export
  image_shape: [3, 112, 112]
  save_inference_dir: "./inference"
  eval_mode: "adaface"

# model architecture
Arch:
  name: "RecModel"
  infer_output_key: "features"
  infer_add_softmax: False
  Backbone: 
    name: "IR_18"
D
dongshuilong 已提交
25
    input_size: [112, 112]
D
dongshuilong 已提交
26 27 28 29 30
  Head:
    name: "AdaMargin"  
    embedding_size: 512
    class_num: 70722
    m: 0.4
D
dongshuilong 已提交
31 32
    s: 64
    h: 0.333
D
dongshuilong 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    t_alpha: 0.01
 
# loss function config for traing/eval process
Loss:
  Train:
    - CELoss:
        weight: 1.0

Optimizer:
  name: Momentum
  momentum: 0.9
  lr:
    name: Piecewise
    learning_rate: 0.1
    decay_epochs: [12, 20, 24]
    values: [0.1, 0.01, 0.001, 0.0001]
  regularizer:
    name: 'L2'
D
dongshuilong 已提交
51
    coeff: 0.0005
D
dongshuilong 已提交
52 53 54 55 56 57

# data loader for train and eval
DataLoader:
  Train:
    dataset:
        name: "AdaFaceDataset"
D
dongshuilong 已提交
58 59
        root_dir: "dataset/face/"
        label_path: "dataset/face/train_filter_label.txt"
D
dongshuilong 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
        low_res_augmentation_prob: 0.2
        crop_augmentation_prob: 0.2
        photometric_augmentation_prob: 0.2
        transform:
          - RandomHorizontalFlip:
          - ToTensor:
          - Normalize:
              mean: [0.5, 0.5, 0.5]
              std: [0.5, 0.5, 0.5]
    sampler:
        name: DistributedBatchSampler
        batch_size: 256
        drop_last: False
        shuffle: True
    loader:
        num_workers: 6
        use_shared_memory: True
D
dongshuilong 已提交
77

D
dongshuilong 已提交
78 79 80
  Eval:
    dataset:
      name: FiveValidationDataset
D
dongshuilong 已提交
81 82
      val_data_path: dataset/face/faces_emore
      concat_mem_file_name: dataset/face/faces_emore/concat_validation_memfile
D
dongshuilong 已提交
83
    sampler:
D
dongshuilong 已提交
84
        name: BatchSampler
D
dongshuilong 已提交
85 86 87 88 89
        batch_size: 256
        drop_last: False
        shuffle: True
    loader:
        num_workers: 6
D
dongshuilong 已提交
90 91 92 93 94
        use_shared_memory: True
Metric:
  Train:
    - TopkAcc:
        topk: [1, 5]