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'
H
HydrogenSulfate 已提交
15
  re_ranking: False
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"
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
35 36 37 38 39 40 41 42
    weight_attr:
      initializer:
        name: KaimingUniform
        fan_in: 12288 # 6*embedding_size
    bias_attr:
      initializer:
        name: KaimingUniform
        fan_in: 12288 # 6*embedding_size
H
HydrogenSulfate 已提交
43

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

Optimizer:
H
HydrogenSulfate 已提交
59
  name: Adam
W
weishengyu 已提交
60 61
  lr:
    name: Piecewise
H
HydrogenSulfate 已提交
62
    decay_epochs: [40, 70]
W
dbg  
weishengyu 已提交
63
    values: [0.00035, 0.000035, 0.0000035]
H
HydrogenSulfate 已提交
64 65
    by_epoch: True
    last_epoch: 0
W
weishengyu 已提交
66 67 68 69 70 71 72 73
  regularizer:
    name: 'L2'
    coeff: 0.0005

# data loader for train and eval
DataLoader:
  Train:
    dataset:
H
HydrogenSulfate 已提交
74 75 76
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "bounding_box_train"
H
HydrogenSulfate 已提交
77
        backend: "pil"
W
weishengyu 已提交
78 79
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
80
              size: [128, 256]
H
HydrogenSulfate 已提交
81
              return_numpy: False
82
              interpolation: 'bilinear'
H
HydrogenSulfate 已提交
83
              backend: "pil"
W
weishengyu 已提交
84 85
          - RandFlipImage:
              flip_code: 1
W
dbg  
weishengyu 已提交
86 87
          - Pad:
              padding: 10
H
HydrogenSulfate 已提交
88
          - RandCropImageV2:
W
dbg  
weishengyu 已提交
89
              size: [128, 256]
H
HydrogenSulfate 已提交
90 91
          - ToTensor:
          - Normalize:
W
weishengyu 已提交
92 93 94
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
    sampler:
W
weishengyu 已提交
95
        name: DistributedRandomIdentitySampler
W
dbg  
weishengyu 已提交
96
        batch_size: 64
W
weishengyu 已提交
97
        num_instances: 4
H
HydrogenSulfate 已提交
98
        drop_last: False
W
weishengyu 已提交
99 100
        shuffle: True
    loader:
H
HydrogenSulfate 已提交
101
        num_workers: 4
W
weishengyu 已提交
102 103 104 105
        use_shared_memory: True
  Eval:
    Query:
      dataset:
H
HydrogenSulfate 已提交
106 107 108
        name: "Market1501"
        image_root: "./dataset/"
        cls_label_path: "query"
H
HydrogenSulfate 已提交
109
        backend: "pil"
W
weishengyu 已提交
110 111
        transform_ops:
          - ResizeImage:
W
dbg  
weishengyu 已提交
112
              size: [128, 256]
H
HydrogenSulfate 已提交
113
              return_numpy: False
114
              interpolation: 'bilinear'
H
HydrogenSulfate 已提交
115
              backend: "pil"
H
HydrogenSulfate 已提交
116 117
          - ToTensor:
          - Normalize:
W
weishengyu 已提交
118 119 120 121
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
      sampler:
        name: DistributedBatchSampler
W
dbg  
weishengyu 已提交
122
        batch_size: 128
W
weishengyu 已提交
123 124 125
        drop_last: False
        shuffle: False
      loader:
H
HydrogenSulfate 已提交
126
        num_workers: 4
W
weishengyu 已提交
127 128 129 130
        use_shared_memory: True

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

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