Cascade-FasterRCNN-ResNet50-vd-SSLDv2-FPN.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. snapshot_epoch: 1
  9. print_flops: false
  10. print_params: false
  11. use_ema: true
  12. # Dataset
  13. metric: COCO
  14. num_classes: 80
  15. TrainDataset:
  16. name: COCODataSet
  17. image_dir: train2017
  18. anno_path: annotations/instances_train2017.json
  19. dataset_dir: dataset/coco
  20. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  21. EvalDataset:
  22. name: COCODataSet
  23. image_dir: val2017
  24. anno_path: annotations/instances_val2017.json
  25. dataset_dir: dataset/coco
  26. allow_empty: true
  27. TestDataset:
  28. name: ImageFolder
  29. anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  30. dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
  31. # Reader
  32. worker_num: 2
  33. TrainReader:
  34. sample_transforms:
  35. - Decode: {}
  36. - RandomResize: {target_size: [[640, 1333], [672, 1333], [704, 1333], [736, 1333], [768, 1333], [800, 1333]], interp: 2, keep_ratio: True}
  37. - RandomFlip: {prob: 0.5}
  38. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  39. - Permute: {}
  40. batch_transforms:
  41. - PadBatch: {pad_to_stride: 32}
  42. batch_size: 1
  43. shuffle: true
  44. drop_last: true
  45. collate_batch: false
  46. EvalReader:
  47. sample_transforms:
  48. - Decode: {}
  49. - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True}
  50. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  51. - Permute: {}
  52. batch_transforms:
  53. - PadBatch: {pad_to_stride: 32}
  54. batch_size: 1
  55. shuffle: false
  56. drop_last: false
  57. TestReader:
  58. sample_transforms:
  59. - Decode: {}
  60. - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True}
  61. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  62. - Permute: {}
  63. batch_transforms:
  64. - PadBatch: {pad_to_stride: 32}
  65. batch_size: 1
  66. shuffle: false
  67. drop_last: false
  68. # Model
  69. architecture: CascadeRCNN
  70. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_vd_ssld_v2_pretrained.pdparams
  71. CascadeRCNN:
  72. backbone: ResNet
  73. neck: FPN
  74. rpn_head: RPNHead
  75. bbox_head: CascadeHead
  76. # post process
  77. bbox_post_process: BBoxPostProcess
  78. ResNet:
  79. # index 0 stands for res2
  80. depth: 50
  81. variant: d
  82. norm_type: bn
  83. freeze_at: 0
  84. return_idx: [0,1,2,3]
  85. num_stages: 4
  86. lr_mult_list: [0.05, 0.05, 0.1, 0.15]
  87. FPN:
  88. out_channel: 256
  89. RPNHead:
  90. anchor_generator:
  91. aspect_ratios: [0.5, 1.0, 2.0]
  92. anchor_sizes: [[32], [64], [128], [256], [512]]
  93. strides: [4, 8, 16, 32, 64]
  94. rpn_target_assign:
  95. batch_size_per_im: 256
  96. fg_fraction: 0.5
  97. negative_overlap: 0.3
  98. positive_overlap: 0.7
  99. use_random: True
  100. train_proposal:
  101. min_size: 0.0
  102. nms_thresh: 0.7
  103. pre_nms_top_n: 2000
  104. post_nms_top_n: 2000
  105. topk_after_collect: True
  106. test_proposal:
  107. min_size: 0.0
  108. nms_thresh: 0.7
  109. pre_nms_top_n: 1000
  110. post_nms_top_n: 1000
  111. CascadeHead:
  112. head: CascadeTwoFCHead
  113. roi_extractor:
  114. resolution: 7
  115. sampling_ratio: 0
  116. aligned: True
  117. bbox_assigner: BBoxAssigner
  118. BBoxAssigner:
  119. batch_size_per_im: 512
  120. bg_thresh: 0.5
  121. fg_thresh: 0.5
  122. fg_fraction: 0.25
  123. cascade_iou: [0.5, 0.6, 0.7]
  124. use_random: True
  125. CascadeTwoFCHead:
  126. out_channel: 1024
  127. BBoxPostProcess:
  128. decode:
  129. name: RCNNBox
  130. prior_box_var: [30.0, 30.0, 15.0, 15.0]
  131. nms:
  132. name: MultiClassNMS
  133. keep_top_k: 100
  134. score_threshold: 0.05
  135. nms_threshold: 0.5
  136. # Optimizer
  137. epoch: 24
  138. LearningRate:
  139. base_lr: 0.01
  140. schedulers:
  141. - !PiecewiseDecay
  142. gamma: 0.1
  143. milestones: [12, 22]
  144. - !LinearWarmup
  145. start_factor: 0.1
  146. steps: 1000
  147. OptimizerBuilder:
  148. optimizer:
  149. momentum: 0.9
  150. type: Momentum
  151. regularizer:
  152. factor: 0.0001
  153. type: L2
  154. # Exporting the model
  155. export:
  156. post_process: True # Whether post-processing is included in the network when export model.
  157. nms: True # Whether NMS is included in the network when export model.
  158. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  159. fuse_conv_bn: False