PP-ShiTuV2_det.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # Runtime
  2. use_gpu: true
  3. use_xpu: false
  4. use_mlu: false
  5. use_npu: false
  6. log_iter: 20
  7. save_dir: output
  8. print_flops: false
  9. print_params: false
  10. find_unused_parameters: True
  11. use_ema: true
  12. cycle_epoch: 20
  13. snapshot_epoch: 2
  14. # Dataset
  15. metric: COCO
  16. num_classes: 1
  17. TrainDataset:
  18. name: COCODataSet
  19. image_dir: train2017
  20. anno_path: annotations/instances_train2017.json
  21. dataset_dir: dataset/coco
  22. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  23. EvalDataset:
  24. name: COCODataSet
  25. image_dir: val2017
  26. anno_path: annotations/instances_val2017.json
  27. dataset_dir: dataset/coco
  28. allow_empty: true
  29. TestDataset:
  30. name: ImageFolder
  31. anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  32. dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
  33. # Reader
  34. worker_num: 6
  35. eval_height: &eval_height 640
  36. eval_width: &eval_width 640
  37. eval_size: &eval_size [*eval_height, *eval_width]
  38. TrainReader:
  39. sample_transforms:
  40. - Decode: {}
  41. - RandomCrop: {}
  42. - RandomFlip: {prob: 0.5}
  43. - RandomDistort: {}
  44. batch_transforms:
  45. - BatchRandomResize: {target_size: [576, 608, 640, 672, 704], random_size: True, random_interp: True, keep_ratio: False}
  46. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  47. - Permute: {}
  48. batch_size: 56
  49. shuffle: true
  50. drop_last: true
  51. collate_batch: false
  52. EvalReader:
  53. sample_transforms:
  54. - Decode: {}
  55. - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  56. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  57. - Permute: {}
  58. batch_transforms:
  59. - PadBatch: {pad_to_stride: 32}
  60. batch_size: 8
  61. shuffle: false
  62. TestReader:
  63. inputs_def:
  64. image_shape: [1, 3, *eval_height, *eval_width]
  65. sample_transforms:
  66. - Decode: {}
  67. - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  68. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  69. - Permute: {}
  70. batch_size: 1
  71. # Model
  72. architecture: PicoDet
  73. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/LCNet_x2_5_ssld_pretrained.pdparams
  74. PicoDet:
  75. backbone: LCNet
  76. neck: CSPPAN
  77. head: PicoHead
  78. LCNet:
  79. scale: 2.5
  80. feature_maps: [3, 4, 5]
  81. ESNet:
  82. scale: 1.0
  83. feature_maps: [4, 11, 14]
  84. act: hard_swish
  85. channel_ratio: [0.875, 0.5, 1.0, 0.625, 0.5, 0.75, 0.625, 0.625, 0.5, 0.625, 1.0, 0.625, 0.75]
  86. CSPPAN:
  87. out_channels: 128
  88. use_depthwise: True
  89. num_csp_blocks: 1
  90. num_features: 4
  91. PicoHead:
  92. conv_feat:
  93. name: PicoFeat
  94. feat_in: 128
  95. feat_out: 128
  96. num_convs: 4
  97. num_fpn_stride: 4
  98. norm_type: bn
  99. share_cls_reg: True
  100. fpn_stride: [8, 16, 32, 64]
  101. feat_in_chan: 128
  102. prior_prob: 0.01
  103. reg_max: 7
  104. cell_offset: 0.5
  105. loss_class:
  106. name: VarifocalLoss
  107. use_sigmoid: True
  108. iou_weighted: True
  109. loss_weight: 1.0
  110. loss_dfl:
  111. name: DistributionFocalLoss
  112. loss_weight: 0.25
  113. loss_bbox:
  114. name: GIoULoss
  115. loss_weight: 2.0
  116. assigner:
  117. name: SimOTAAssigner
  118. candidate_topk: 10
  119. iou_weight: 6
  120. nms:
  121. name: MultiClassNMS
  122. nms_top_k: 1000
  123. keep_top_k: 100
  124. score_threshold: 0.025
  125. nms_threshold: 0.6
  126. # Optimizer
  127. epoch: 100
  128. LearningRate:
  129. base_lr: 0.4
  130. schedulers:
  131. - name: CosineDecay
  132. max_epochs: 100
  133. - name: LinearWarmup
  134. start_factor: 0.1
  135. steps: 300
  136. OptimizerBuilder:
  137. optimizer:
  138. momentum: 0.9
  139. type: Momentum
  140. regularizer:
  141. factor: 0.00004
  142. type: L2
  143. # Exporting the model
  144. export:
  145. post_process: True # Whether post-processing is included in the network when export model.
  146. nms: True # Whether NMS is included in the network when export model.
  147. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  148. fuse_conv_bn: False