denseteacher_fcos_r50_fpn_coco_semi005.yml 3.8 KB

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