Cascade-MaskRCNN-ResNet50-vd-SSLDv2-FPN.yaml 4.3 KB

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