PicoDet-M.yaml 3.7 KB

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