picodet_l_640_coco_lcnet_lvjian1.yml 3.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
weights: output/picodet_l_640_coco_lcnet_lvjian1/model_final
pretrain_weights: https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams

worker_num: 2
eval_height: &eval_height 640
eval_width: &eval_width 640
eval_size: &eval_size [*eval_height, *eval_width]

metric: COCO
num_classes: 5

TrainDataset:
  !COCODataSet
    image_dir: images
    anno_path: train.json
    dataset_dir: /paddle/dataset/model-select/gongye/lvjian1/slice_lvjian1_data/train/
    data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']

EvalDataset:
  !COCODataSet
    image_dir: images
    anno_path: val.json
    dataset_dir: /paddle/dataset/model-select/gongye/lvjian1/slice_lvjian1_data/eval/

TestDataset:
  !ImageFolder
    anno_path: val.json
    dataset_dir: dataset/slice_lvjian1_data/eval

epoch: 50
LearningRate:
  base_lr: 0.006
  schedulers:
  - !CosineDecay
    max_epochs: 50
  - !LinearWarmup
    start_factor: 0.001
    steps: 300

TrainReader:
  sample_transforms:
  - Decode: {}
  - RandomCrop: {}
  - RandomFlip: {prob: 0.5}
  - RandomDistort: {}
  batch_transforms:
  - BatchRandomResize: {target_size: [576, 608, 640, 672, 704], random_size: True, random_interp: True, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  - PadGT: {}
  batch_size: 8
  shuffle: true
  drop_last: true


EvalReader:
  sample_transforms:
  - Decode: {}
  - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  batch_transforms:
  - PadBatch: {pad_to_stride: 32}
  batch_size: 8
  shuffle: false


TestReader:
  inputs_def:
    image_shape: [1, 3, *eval_height, *eval_width]
  sample_transforms:
  - Decode: {}
  - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  batch_size: 1


use_gpu: true
use_xpu: false
log_iter: 100
save_dir: output
snapshot_epoch: 10
print_flops: false
find_unused_parameters: True
use_ema: true


# Exporting the model
export:
  post_process: True  # Whether post-processing is included in the network when export model.
  nms: True           # Whether NMS is included in the network when export model.
  benchmark: False    # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.

OptimizerBuilder:
  optimizer:
    momentum: 0.9
    type: Momentum
  regularizer:
    factor: 0.00004
    type: L2

architecture: PicoDet

PicoDet:
  backbone: LCNet
  neck: LCPAN
  head: PicoHeadV2

LCNet:
  scale: 2.0
  feature_maps: [3, 4, 5]

LCPAN:
  out_channels: 160
  use_depthwise: True
  num_features: 4

PicoHeadV2:
  conv_feat:
    name: PicoFeat
    feat_in: 160
    feat_out: 160
    num_convs: 4
    num_fpn_stride: 4
    norm_type: bn
    share_cls_reg: True
    use_se: True
  fpn_stride: [8, 16, 32, 64]
  feat_in_chan: 160
  prior_prob: 0.01
  reg_max: 7
  cell_offset: 0.5
  grid_cell_scale: 5.0
  static_assigner_epoch: 100
  use_align_head: True
  static_assigner:
    name: ATSSAssigner
    topk: 9
    force_gt_matching: False
  assigner:
    name: TaskAlignedAssigner
    topk: 13
    alpha: 1.0
    beta: 6.0
  loss_class:
    name: VarifocalLoss
    use_sigmoid: False
    iou_weighted: True
    loss_weight: 1.0
  loss_dfl:
    name: DistributionFocalLoss
    loss_weight: 0.5
  loss_bbox:
    name: GIoULoss
    loss_weight: 2.5
  nms:
    name: MultiClassNMS
    nms_top_k: 1000
    keep_top_k: 100
    score_threshold: 0.025
    nms_threshold: 0.6