denseteacher_fcos_r50_fpn_coco_semi010.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. _BASE_: [
  2. '../../fcos/fcos_r50_fpn_iou_multiscale_2x_coco.yml',
  3. '../_base_/coco_detection_percent_10.yml',
  4. ]
  5. log_iter: 50
  6. snapshot_epoch: 5
  7. epochs: &epochs 240
  8. weights: output/denseteacher_fcos_r50_fpn_coco_semi010/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: 4.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. # default 0.5
  54. multiply_strides_reg_targets: False
  55. norm_reg_targets: True
  56. unsup_batch_transforms:
  57. - Permute: {}
  58. - PadBatch: {pad_to_stride: 32}
  59. sup_batch_size: 2
  60. unsup_batch_size: 2
  61. shuffle: True
  62. drop_last: True
  63. EvalReader:
  64. sample_transforms:
  65. - Decode: {}
  66. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  67. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  68. - Permute: {}
  69. batch_transforms:
  70. - PadBatch: {pad_to_stride: 32}
  71. batch_size: 1
  72. TestReader:
  73. sample_transforms:
  74. - Decode: {}
  75. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  76. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  77. - Permute: {}
  78. batch_transforms:
  79. - PadBatch: {pad_to_stride: 32}
  80. batch_size: 1
  81. fuse_normalize: True
  82. ### model config
  83. architecture: FCOS
  84. FCOS:
  85. backbone: ResNet
  86. neck: FPN
  87. fcos_head: FCOSHead
  88. ResNet:
  89. depth: 50
  90. variant: 'b'
  91. norm_type: bn
  92. freeze_at: 0 # res2
  93. return_idx: [1, 2, 3]
  94. num_stages: 4
  95. FPN:
  96. out_channel: 256
  97. spatial_scales: [0.125, 0.0625, 0.03125]
  98. extra_stage: 2
  99. has_extra_convs: True
  100. use_c5: False
  101. FCOSHead:
  102. fcos_feat:
  103. name: FCOSFeat
  104. feat_in: 256
  105. feat_out: 256
  106. num_convs: 4
  107. norm_type: "gn"
  108. use_dcn: False
  109. fpn_stride: [8, 16, 32, 64, 128]
  110. prior_prob: 0.01
  111. norm_reg_targets: True
  112. centerness_on_reg: True
  113. num_shift: 0. # default 0.5
  114. multiply_strides_reg_targets: False
  115. sqrt_score: False
  116. fcos_loss:
  117. name: FCOSLoss
  118. loss_alpha: 0.25
  119. loss_gamma: 2.0
  120. iou_loss_type: "giou"
  121. reg_weights: 1.0
  122. quality: "iou"
  123. nms:
  124. name: MultiClassNMS
  125. nms_top_k: 1000
  126. keep_top_k: 100
  127. score_threshold: 0.025
  128. nms_threshold: 0.6
  129. ### other config
  130. epoch: *epochs
  131. LearningRate:
  132. base_lr: 0.01
  133. schedulers:
  134. - !PiecewiseDecay
  135. gamma: 0.1
  136. milestones: [*epochs]
  137. use_warmup: *use_warmup
  138. - !LinearWarmup
  139. start_factor: 0.001
  140. steps: 1000
  141. OptimizerBuilder:
  142. optimizer:
  143. momentum: 0.9
  144. type: Momentum
  145. regularizer:
  146. factor: 0.0001
  147. type: L2
  148. clip_grad_by_value: 1.0