baseline.yaml 3.6 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
  eval_mode: "retrieval"
H
HydrogenSulfate 已提交
14
  retrieval_feature_from: "backbone" # 'backbone' or 'neck'
W
weishengyu 已提交
15
  # used for static mode and model export
H
HydrogenSulfate 已提交
16
  image_shape: [3, 256, 128]
W
weishengyu 已提交
17 18 19 20 21 22 23
  save_inference_dir: "./inference"

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

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

Optimizer:
H
HydrogenSulfate 已提交
58
  name: Adam
W
weishengyu 已提交
59 60
  lr:
    name: Piecewise
H
HydrogenSulfate 已提交
61
    decay_epochs: [40, 70]
W
dbg  
weishengyu 已提交
62
    values: [0.00035, 0.000035, 0.0000035]
H
HydrogenSulfate 已提交
63 64
    by_epoch: True
    last_epoch: 0
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"
H
HydrogenSulfate 已提交
76
        backend: "pil"
W
weishengyu 已提交
77 78
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
79
              size: [128, 256]
H
HydrogenSulfate 已提交
80
              return_numpy: False
81
              interpolation: 'bilinear'
H
HydrogenSulfate 已提交
82
              backend: "pil"
W
weishengyu 已提交
83 84
          - RandFlipImage:
              flip_code: 1
W
dbg  
weishengyu 已提交
85 86
          - Pad:
              padding: 10
H
HydrogenSulfate 已提交
87
          - RandCropImageV2:
W
dbg  
weishengyu 已提交
88
              size: [128, 256]
H
HydrogenSulfate 已提交
89 90
          - ToTensor:
          - Normalize:
W
weishengyu 已提交
91 92 93
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
    sampler:
W
weishengyu 已提交
94
        name: DistributedRandomIdentitySampler
W
dbg  
weishengyu 已提交
95
        batch_size: 64
W
weishengyu 已提交
96
        num_instances: 4
H
HydrogenSulfate 已提交
97
        drop_last: False
W
weishengyu 已提交
98 99
        shuffle: True
    loader:
H
HydrogenSulfate 已提交
100
        num_workers: 4
W
weishengyu 已提交
101 102 103 104
        use_shared_memory: True
  Eval:
    Query:
      dataset:
H
HydrogenSulfate 已提交
105 106 107
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "query"
H
HydrogenSulfate 已提交
108
        backend: "pil"
W
weishengyu 已提交
109 110
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
111
              size: [128, 256]
H
HydrogenSulfate 已提交
112
              return_numpy: False
113
              interpolation: 'bilinear'
H
HydrogenSulfate 已提交
114
              backend: "pil"
H
HydrogenSulfate 已提交
115 116
          - ToTensor:
          - Normalize:
W
weishengyu 已提交
117 118 119 120
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
121
        batch_size: 128
W
weishengyu 已提交
122 123 124
        drop_last: False
        shuffle: False
      loader:
H
HydrogenSulfate 已提交
125
        num_workers: 4
W
weishengyu 已提交
126 127 128 129
        use_shared_memory: True

    Gallery:
      dataset:
H
HydrogenSulfate 已提交
130 131 132
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "bounding_box_test"
H
HydrogenSulfate 已提交
133
        backend: "pil"
W
weishengyu 已提交
134 135
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
136
              size: [128, 256]
H
HydrogenSulfate 已提交
137
              return_numpy: False
138
              interpolation: 'bilinear'
H
HydrogenSulfate 已提交
139
              backend: "pil"
H
HydrogenSulfate 已提交
140 141
          - ToTensor:
          - Normalize:
W
weishengyu 已提交
142 143 144 145
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
146
        batch_size: 128
W
weishengyu 已提交
147 148 149
        drop_last: False
        shuffle: False
      loader:
H
HydrogenSulfate 已提交
150
        num_workers: 4
W
weishengyu 已提交
151 152 153 154 155 156 157
        use_shared_memory: True

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