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

# model architecture
Arch:
  name: "RecModel"
  infer_output_key: "features"
  infer_add_softmax: False
H
HydrogenSulfate 已提交
25
  Backbone:
H
HydrogenSulfate 已提交
26
    name: "ResNet50_last_stage_stride1"
W
weishengyu 已提交
27
    pretrained: True
W
dbg  
weishengyu 已提交
28
    stem_act: null
W
weishengyu 已提交
29
  BackboneStopLayer:
W
dbg  
weishengyu 已提交
30
    name: "flatten"
W
weishengyu 已提交
31
  Head:
H
HydrogenSulfate 已提交
32
    name: "FC"
W
weishengyu 已提交
33
    embedding_size: 2048
W
dbg  
weishengyu 已提交
34
    class_num: 751
H
HydrogenSulfate 已提交
35 36 37 38 39 40
    weight_attr:
      initializer:
        name: Normal
        std: 0.001
    bias_attr: False

W
weishengyu 已提交
41 42 43 44 45
# loss function config for traing/eval process
Loss:
  Train:
    - CELoss:
        weight: 1.0
W
weishengyu 已提交
46
        epsilon: 0.1
W
dbg  
weishengyu 已提交
47
    - TripletLossV2:
W
weishengyu 已提交
48
        weight: 1.0
W
weishengyu 已提交
49 50
        margin: 0.3
        normalize_feature: false
H
HydrogenSulfate 已提交
51
        feat_from: "backbone"
W
weishengyu 已提交
52 53 54 55 56
  Eval:
    - CELoss:
        weight: 1.0

Optimizer:
H
HydrogenSulfate 已提交
57 58
  name: Momentum
  momentum: 0.9
W
weishengyu 已提交
59 60
  lr:
    name: Piecewise
W
weishengyu 已提交
61
    decay_epochs: [30, 60]
W
dbg  
weishengyu 已提交
62
    values: [0.00035, 0.000035, 0.0000035]
W
weishengyu 已提交
63 64
    warmup_epoch: 10
    warmup_start_lr: 0.0000035
W
weishengyu 已提交
65 66 67 68 69 70 71 72
  regularizer:
    name: 'L2'
    coeff: 0.0005

# data loader for train and eval
DataLoader:
  Train:
    dataset:
H
HydrogenSulfate 已提交
73 74 75
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "bounding_box_train"
W
weishengyu 已提交
76 77
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
78
              size: [128, 256]
W
weishengyu 已提交
79 80
          - RandFlipImage:
              flip_code: 1
W
dbg  
weishengyu 已提交
81 82
          - Pad:
              padding: 10
W
weishengyu 已提交
83
          - RandCropImage:
W
dbg  
weishengyu 已提交
84
              size: [128, 256]
W
weishengyu 已提交
85 86
              scale: [0.8022, 0.8022]
              ratio: [0.5, 0.5]
W
weishengyu 已提交
87 88 89 90 91
          - NormalizeImage:
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
              order: ''
    sampler:
W
weishengyu 已提交
92
        name: DistributedRandomIdentitySampler
W
dbg  
weishengyu 已提交
93
        batch_size: 64
W
weishengyu 已提交
94
        num_instances: 4
W
weishengyu 已提交
95 96 97
        drop_last: True
        shuffle: True
    loader:
H
HydrogenSulfate 已提交
98
        num_workers: 4
W
weishengyu 已提交
99 100 101 102
        use_shared_memory: True
  Eval:
    Query:
      dataset:
H
HydrogenSulfate 已提交
103 104 105
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "query"
W
weishengyu 已提交
106 107
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
108
              size: [128, 256]
W
weishengyu 已提交
109 110 111 112 113 114
          - NormalizeImage:
              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
        drop_last: False
        shuffle: False
      loader:
H
HydrogenSulfate 已提交
119
        num_workers: 4
W
weishengyu 已提交
120 121 122 123
        use_shared_memory: True

    Gallery:
      dataset:
H
HydrogenSulfate 已提交
124 125 126
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "bounding_box_test"
W
weishengyu 已提交
127 128
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
129
              size: [128, 256]
W
weishengyu 已提交
130 131 132 133 134 135
          - NormalizeImage:
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
              order: ''
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
136
        batch_size: 128
W
weishengyu 已提交
137 138 139
        drop_last: False
        shuffle: False
      loader:
H
HydrogenSulfate 已提交
140
        num_workers: 4
W
weishengyu 已提交
141 142 143 144 145 146 147
        use_shared_memory: True

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