MaskRCNN-ResNet50.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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
  30. dataset_dir: dataset/coco
  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: -1}
  40. batch_size: 1
  41. shuffle: true
  42. drop_last: true
  43. collate_batch: false
  44. use_shared_memory: true
  45. EvalReader:
  46. sample_transforms:
  47. - Decode: {}
  48. - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True}
  49. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  50. - Permute: {}
  51. batch_transforms:
  52. - PadBatch: {pad_to_stride: -1}
  53. batch_size: 1
  54. shuffle: false
  55. drop_last: false
  56. TestReader:
  57. sample_transforms:
  58. - Decode: {}
  59. - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True}
  60. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  61. - Permute: {}
  62. batch_transforms:
  63. - PadBatch: {pad_to_stride: -1}
  64. batch_size: 1
  65. shuffle: false
  66. drop_last: false
  67. LearningRate:
  68. base_lr: 0.01
  69. schedulers:
  70. - !PiecewiseDecay
  71. gamma: 0.1
  72. milestones: [8, 11]
  73. - !LinearWarmup
  74. start_factor: 0.001
  75. steps: 1000
  76. OptimizerBuilder:
  77. optimizer:
  78. momentum: 0.9
  79. type: Momentum
  80. regularizer:
  81. factor: 0.0001
  82. type: L2
  83. # model
  84. architecture: MaskRCNN
  85. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
  86. MaskRCNN:
  87. backbone: ResNet
  88. rpn_head: RPNHead
  89. bbox_head: BBoxHead
  90. mask_head: MaskHead
  91. # post process
  92. bbox_post_process: BBoxPostProcess
  93. mask_post_process: MaskPostProcess
  94. ResNet:
  95. # index 0 stands for res2
  96. depth: 50
  97. norm_type: bn
  98. freeze_at: 0
  99. return_idx: [2]
  100. num_stages: 3
  101. RPNHead:
  102. anchor_generator:
  103. aspect_ratios: [0.5, 1.0, 2.0]
  104. anchor_sizes: [32, 64, 128, 256, 512]
  105. strides: [16]
  106. rpn_target_assign:
  107. batch_size_per_im: 256
  108. fg_fraction: 0.5
  109. negative_overlap: 0.3
  110. positive_overlap: 0.7
  111. use_random: True
  112. train_proposal:
  113. min_size: 0.0
  114. nms_thresh: 0.7
  115. pre_nms_top_n: 12000
  116. post_nms_top_n: 2000
  117. topk_after_collect: False
  118. test_proposal:
  119. min_size: 0.0
  120. nms_thresh: 0.7
  121. pre_nms_top_n: 6000
  122. post_nms_top_n: 1000
  123. BBoxHead:
  124. head: Res5Head
  125. roi_extractor:
  126. resolution: 14
  127. sampling_ratio: 0
  128. aligned: True
  129. bbox_assigner: BBoxAssigner
  130. with_pool: true
  131. BBoxAssigner:
  132. batch_size_per_im: 512
  133. bg_thresh: 0.5
  134. fg_thresh: 0.5
  135. fg_fraction: 0.25
  136. use_random: True
  137. BBoxPostProcess:
  138. decode: RCNNBox
  139. nms:
  140. name: MultiClassNMS
  141. keep_top_k: 100
  142. score_threshold: 0.05
  143. nms_threshold: 0.5
  144. MaskHead:
  145. head: MaskFeat
  146. roi_extractor:
  147. resolution: 14
  148. sampling_ratio: 0
  149. aligned: True
  150. mask_assigner: MaskAssigner
  151. share_bbox_feat: true
  152. MaskFeat:
  153. num_convs: 0
  154. out_channel: 256
  155. MaskAssigner:
  156. mask_resolution: 14
  157. MaskPostProcess:
  158. binary_thresh: 0.5
  159. # Exporting the model
  160. export:
  161. post_process: True
  162. nms: True
  163. benchmark: False
  164. fuse_conv_bn: False