SOLOv2.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. epoch: 12
  2. use_gpu: true
  3. use_xpu: false
  4. use_mlu: false
  5. use_npu: false
  6. target_metrics: mask
  7. log_iter: 20
  8. save_dir: output
  9. snapshot_epoch: 1
  10. print_flops: false
  11. print_params: false
  12. # Dataset
  13. metric: COCO
  14. num_classes: 80
  15. worker_num: 8
  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. - Poly2Mask: {}
  35. - Resize: {interp: 1, target_size: [800, 1333], keep_ratio: True}
  36. - RandomFlip: {}
  37. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  38. - Permute: {}
  39. batch_transforms:
  40. - PadBatch: {pad_to_stride: 32}
  41. - Gt2Solov2Target: {num_grids: [40, 36, 24, 16, 12],
  42. scale_ranges: [[1, 96], [48, 192], [96, 384], [192, 768], [384, 2048]],
  43. coord_sigma: 0.2}
  44. batch_size: 2
  45. shuffle: true
  46. drop_last: true
  47. EvalReader:
  48. sample_transforms:
  49. - Decode: {}
  50. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  51. - Resize: {interp: 1, target_size: [800, 1333], keep_ratio: True}
  52. - Permute: {}
  53. batch_transforms:
  54. - PadBatch: {pad_to_stride: 32}
  55. batch_size: 1
  56. shuffle: false
  57. drop_last: false
  58. TestReader:
  59. sample_transforms:
  60. - Decode: {}
  61. - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  62. - Resize: {interp: 1, target_size: [800, 1333], keep_ratio: True}
  63. - Permute: {}
  64. batch_transforms:
  65. - PadBatch: {pad_to_stride: 32}
  66. batch_size: 1
  67. shuffle: false
  68. drop_last: false
  69. LearningRate:
  70. base_lr: 0.01
  71. schedulers:
  72. - !PiecewiseDecay
  73. gamma: 0.1
  74. milestones: [8, 11]
  75. - !LinearWarmup
  76. start_factor: 0.
  77. steps: 1000
  78. OptimizerBuilder:
  79. optimizer:
  80. momentum: 0.9
  81. type: Momentum
  82. regularizer:
  83. factor: 0.0001
  84. type: L2
  85. # Model
  86. architecture: SOLOv2
  87. pretrain_weights: https://paddledet.bj.bcebos.com/models/solov2_r50_fpn_1x_coco.pdparams
  88. SOLOv2:
  89. backbone: ResNet
  90. neck: FPN
  91. solov2_head: SOLOv2Head
  92. mask_head: SOLOv2MaskHead
  93. ResNet:
  94. depth: 50
  95. freeze_at: 0
  96. return_idx: [0,1,2,3]
  97. num_stages: 4
  98. FPN:
  99. out_channel: 256
  100. SOLOv2Head:
  101. seg_feat_channels: 512
  102. stacked_convs: 4
  103. num_grids: [40, 36, 24, 16, 12]
  104. kernel_out_channels: 256
  105. solov2_loss: SOLOv2Loss
  106. mask_nms: MaskMatrixNMS
  107. SOLOv2MaskHead:
  108. mid_channels: 128
  109. out_channels: 256
  110. start_level: 0
  111. end_level: 3
  112. SOLOv2Loss:
  113. ins_loss_weight: 3.0
  114. focal_loss_gamma: 2.0
  115. focal_loss_alpha: 0.25
  116. MaskMatrixNMS:
  117. pre_nms_top_n: 500
  118. post_nms_top_n: 100
  119. # Exporting the model
  120. export:
  121. post_process: True
  122. nms: True
  123. benchmark: False
  124. fuse_conv_bn: False