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

# model architecture
Arch:
  name: "RecModel"
  infer_output_key: "features"
  infer_add_softmax: False
  Backbone:
    name: "ResNet50"
    pretrained: True
W
dbg  
weishengyu 已提交
26
    stem_act: null
W
weishengyu 已提交
27
  BackboneStopLayer:
W
dbg  
weishengyu 已提交
28
    name: "flatten"
W
weishengyu 已提交
29 30 31
  Head:
    name: "FC"
    embedding_size: 2048
W
dbg  
weishengyu 已提交
32
    class_num: 751
W
weishengyu 已提交
33 34 35 36 37 38

# loss function config for traing/eval process
Loss:
  Train:
    - CELoss:
        weight: 1.0
W
dbg  
weishengyu 已提交
39
    - TripletLossV2:
W
weishengyu 已提交
40
        weight: 1.0
W
weishengyu 已提交
41 42
        margin: 0.3
        normalize_feature: false
W
weishengyu 已提交
43 44 45 46 47 48 49 50
  Eval:
    - CELoss:
        weight: 1.0

Optimizer:
  name: Adam
  lr:
    name: Piecewise
W
dbg  
weishengyu 已提交
51
    decay_epochs: [40, 70]
W
dbg  
weishengyu 已提交
52
    values: [0.00035, 0.000035, 0.0000035]
W
weishengyu 已提交
53 54 55 56 57 58 59 60 61
  regularizer:
    name: 'L2'
    coeff: 0.0005

# data loader for train and eval
DataLoader:
  Train:
    dataset:
        name: "VeriWild"
W
weishengyu 已提交
62 63
        image_root: "./dataset/market1501"
        cls_label_path: "./dataset/market1501/bounding_box_train.txt"
W
weishengyu 已提交
64 65 66 67 68
        transform_ops:
          - DecodeImage:
              to_rgb: True
              channel_first: False
          - ResizeImage:
W
dbg  
weishengyu 已提交
69
              size: [128, 256]
W
weishengyu 已提交
70 71
          - RandFlipImage:
              flip_code: 1
W
dbg  
weishengyu 已提交
72 73
          - Pad:
              padding: 10
W
weishengyu 已提交
74
          - RandCropImage:
W
dbg  
weishengyu 已提交
75
              size: [128, 256]
W
weishengyu 已提交
76 77 78 79 80 81 82 83 84 85 86 87 88
          - NormalizeImage:
              scale: 0.00392157
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
              order: ''
          - RandomErasing:
              EPSILON: 0.5
              sl: 0.02
              sh: 0.4
              r1: 0.3
              mean: [0.4914, 0.4822, 0.4465]
    sampler:
        name: PKSampler
W
dbg  
weishengyu 已提交
89
        batch_size: 64
W
weishengyu 已提交
90 91 92 93 94 95 96 97 98 99
        sample_per_id: 4
        drop_last: True
        shuffle: True
    loader:
        num_workers: 6
        use_shared_memory: True
  Eval:
    Query:
      dataset:
        name: "VeriWild"
W
weishengyu 已提交
100 101
        image_root: "./dataset/market1501"
        cls_label_path: "./dataset/market1501/query.txt"
W
weishengyu 已提交
102 103 104 105 106
        transform_ops:
          - DecodeImage:
              to_rgb: True
              channel_first: False
          - ResizeImage:
W
dbg  
weishengyu 已提交
107
              size: [128, 256]
W
weishengyu 已提交
108 109 110 111 112 113 114
          - NormalizeImage:
              scale: 0.00392157
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
              order: ''
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
115
        batch_size: 128
W
weishengyu 已提交
116 117 118 119 120 121 122 123 124
        drop_last: False
        shuffle: False
      loader:
        num_workers: 6
        use_shared_memory: True

    Gallery:
      dataset:
        name: "VeriWild"
W
weishengyu 已提交
125 126
        image_root: "./dataset/market1501"
        cls_label_path: "./dataset/market1501/bounding_box_test.txt"
W
weishengyu 已提交
127 128 129 130 131
        transform_ops:
          - DecodeImage:
              to_rgb: True
              channel_first: False
          - ResizeImage:
W
dbg  
weishengyu 已提交
132
              size: [128, 256]
W
weishengyu 已提交
133 134 135 136 137 138 139
          - NormalizeImage:
              scale: 0.00392157
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
              order: ''
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
140
        batch_size: 128
W
weishengyu 已提交
141 142 143 144 145 146 147 148 149 150 151 152
        drop_last: False
        shuffle: False
      loader:
        num_workers: 6
        use_shared_memory: True

Metric:
  Eval:
    - Recallk:
        topk: [1, 5]
    - mAP: {}