denseteacher_fcos_r50_fpn_coco_full.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. _BASE_: [
  2. 'denseteacher_fcos_r50_fpn_coco_semi010.yml',
  3. '../_base_/coco_detection_full.yml',
  4. ]
  5. log_iter: 100
  6. snapshot_epoch: 2
  7. epochs: &epochs 24
  8. weights: output/denseteacher_fcos_r50_fpn_coco_full/model_final
  9. ### pretrain and warmup config, choose one and coment another
  10. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
  11. semi_start_iters: 5000
  12. ema_start_iters: 3000
  13. use_warmup: &use_warmup True
  14. ### global config
  15. use_simple_ema: True
  16. ema_decay: 0.9996
  17. ssod_method: DenseTeacher
  18. DenseTeacher:
  19. train_cfg:
  20. sup_weight: 1.0
  21. unsup_weight: 1.0
  22. loss_weight: {distill_loss_cls: 2.0, distill_loss_box: 1.0, distill_loss_quality: 1.0}
  23. concat_sup_data: True
  24. suppress: linear
  25. ratio: 0.01
  26. gamma: 2.0
  27. test_cfg:
  28. inference_on: teacher
  29. ### reader config
  30. worker_num: 2
  31. SemiTrainReader:
  32. sample_transforms:
  33. - Decode: {}
  34. - RandomResize: {target_size: [[640, 1333], [672, 1333], [704, 1333], [736, 1333], [768, 1333], [800, 1333]], keep_ratio: True, interp: 1}
  35. - RandomFlip: {}
  36. weak_aug:
  37. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: true}
  38. strong_aug:
  39. - StrongAugImage: {transforms: [
  40. RandomColorJitter: {prob: 0.8, brightness: 0.4, contrast: 0.4, saturation: 0.4, hue: 0.1},
  41. RandomErasingCrop: {},
  42. RandomGaussianBlur: {prob: 0.5, sigma: [0.1, 2.0]},
  43. RandomGrayscale: {prob: 0.2},
  44. ]}
  45. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: true}
  46. sup_batch_transforms:
  47. - Permute: {}
  48. - PadBatch: {pad_to_stride: 32}
  49. - Gt2FCOSTarget:
  50. object_sizes_boundary: [64, 128, 256, 512]
  51. center_sampling_radius: 1.5
  52. downsample_ratios: [8, 16, 32, 64, 128]
  53. num_shift: 0.5
  54. norm_reg_targets: True
  55. unsup_batch_transforms:
  56. - Permute: {}
  57. - PadBatch: {pad_to_stride: 32}
  58. sup_batch_size: 2
  59. unsup_batch_size: 2
  60. shuffle: True
  61. drop_last: True
  62. EvalReader:
  63. sample_transforms:
  64. - Decode: {}
  65. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  66. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  67. - Permute: {}
  68. batch_transforms:
  69. - PadBatch: {pad_to_stride: 32}
  70. batch_size: 1
  71. TestReader:
  72. sample_transforms:
  73. - Decode: {}
  74. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  75. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  76. - Permute: {}
  77. batch_transforms:
  78. - PadBatch: {pad_to_stride: 32}
  79. batch_size: 1
  80. fuse_normalize: True
  81. ### model config
  82. architecture: FCOS
  83. FCOS:
  84. backbone: ResNet
  85. neck: FPN
  86. fcos_head: FCOSHead
  87. ResNet:
  88. depth: 50
  89. variant: 'b'
  90. norm_type: bn
  91. freeze_at: 0 # res2
  92. return_idx: [1, 2, 3]
  93. num_stages: 4
  94. FPN:
  95. out_channel: 256
  96. spatial_scales: [0.125, 0.0625, 0.03125]
  97. extra_stage: 2
  98. has_extra_convs: True
  99. use_c5: False
  100. FCOSHead:
  101. fcos_feat:
  102. name: FCOSFeat
  103. feat_in: 256
  104. feat_out: 256
  105. num_convs: 4
  106. norm_type: "gn"
  107. use_dcn: False
  108. fpn_stride: [8, 16, 32, 64, 128]
  109. prior_prob: 0.01
  110. norm_reg_targets: True
  111. centerness_on_reg: True
  112. num_shift: 0.5
  113. fcos_loss:
  114. name: FCOSLoss
  115. loss_alpha: 0.25
  116. loss_gamma: 2.0
  117. iou_loss_type: "giou"
  118. reg_weights: 1.0
  119. quality: "iou"
  120. nms:
  121. name: MultiClassNMS
  122. nms_top_k: 1000
  123. keep_top_k: 100
  124. score_threshold: 0.025
  125. nms_threshold: 0.6
  126. ### other config
  127. epoch: *epochs
  128. LearningRate:
  129. base_lr: 0.01
  130. schedulers:
  131. - !PiecewiseDecay
  132. gamma: 0.1
  133. milestones: [*epochs]
  134. use_warmup: *use_warmup
  135. - !LinearWarmup
  136. start_factor: 0.001
  137. steps: 1000
  138. OptimizerBuilder:
  139. optimizer:
  140. momentum: 0.9
  141. type: Momentum
  142. regularizer:
  143. factor: 0.0001
  144. type: L2
  145. clip_grad_by_value: 1.0