PicoDet-L_layout_3cls.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Runtime
  2. epoch: 100
  3. log_iter: 10
  4. find_unused_parameters: true
  5. use_gpu: true
  6. use_xpu: false
  7. use_mlu: false
  8. use_npu: false
  9. use_ema: true
  10. save_dir: output
  11. snapshot_epoch: 10
  12. print_flops: false
  13. print_params: false
  14. # Dataset
  15. metric: COCO
  16. num_classes: 3
  17. worker_num: 6
  18. eval_height: &eval_height 640
  19. eval_width: &eval_width 640
  20. eval_size: &eval_size [*eval_height, *eval_width]
  21. TrainDataset:
  22. name: COCODetDataset
  23. image_dir: images
  24. anno_path: annotations/instance_train.json
  25. dataset_dir: datasets/COCO
  26. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  27. EvalDataset:
  28. name: COCODetDataset
  29. image_dir: images
  30. anno_path: annotations/instance_val.json
  31. dataset_dir: datasets/COCO
  32. allow_empty: true
  33. TestDataset:
  34. name: ImageFolder
  35. anno_path: annotations/instance_val.json
  36. dataset_dir: datasets/COCO
  37. TrainReader:
  38. sample_transforms:
  39. - Decode: {}
  40. - RandomCrop: {}
  41. - RandomFlip: {prob: 0.5}
  42. - RandomDistort: {}
  43. batch_transforms:
  44. - BatchRandomResize: {target_size: [576, 608, 640, 672, 704], 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: 16
  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://paddle-model-ecology.bj.bcebos.com/paddlex/pretrained/PicoDet-L_layout_pretrained_v1.pdparams
  73. PicoDet:
  74. backbone: LCNet
  75. neck: LCPAN
  76. head: PicoHeadV2
  77. LCNet:
  78. scale: 2.0
  79. feature_maps: [3, 4, 5]
  80. LCPAN:
  81. out_channels: 160
  82. use_depthwise: true
  83. num_features: 4
  84. PicoHeadV2:
  85. conv_feat:
  86. name: PicoFeat
  87. feat_in: 160
  88. feat_out: 160
  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: 160
  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. LearningRate:
  130. base_lr: 0.06
  131. schedulers:
  132. - name: CosineDecay
  133. max_epochs: 150
  134. - name: LinearWarmup
  135. start_factor: 0.1
  136. steps: 300
  137. OptimizerBuilder:
  138. optimizer:
  139. momentum: 0.9
  140. type: Momentum
  141. regularizer:
  142. factor: 0.00004
  143. type: L2
  144. # Export
  145. export:
  146. post_process: true
  147. nms: true
  148. benchmark: false
  149. fuse_conv_bn: false