FCOS-ResNet50.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # Runtime
  2. use_ema: true
  3. use_gpu: true
  4. use_xpu: false
  5. use_mlu: false
  6. use_npu: false
  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. TrainDataset:
  16. name: COCODataSet
  17. image_dir: train2017
  18. anno_path: annotations/instances_train2017.json
  19. dataset_dir: dataset/coco
  20. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  21. EvalDataset:
  22. name: COCODataSet
  23. image_dir: val2017
  24. anno_path: annotations/instances_val2017.json
  25. dataset_dir: dataset/coco
  26. allow_empty: true
  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. # Reader
  32. worker_num: 2
  33. TrainReader:
  34. sample_transforms:
  35. - Decode: {}
  36. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  37. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  38. - RandomFlip: {}
  39. batch_transforms:
  40. - Permute: {}
  41. - PadBatch: {pad_to_stride: 128}
  42. - Gt2FCOSTarget:
  43. object_sizes_boundary: [64, 128, 256, 512]
  44. center_sampling_radius: 1.5
  45. downsample_ratios: [8, 16, 32, 64, 128]
  46. norm_reg_targets: True
  47. batch_size: 2
  48. shuffle: True
  49. drop_last: True
  50. use_shared_memory: True
  51. EvalReader:
  52. sample_transforms:
  53. - Decode: {}
  54. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  55. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  56. - Permute: {}
  57. batch_transforms:
  58. - PadBatch: {pad_to_stride: 128}
  59. batch_size: 1
  60. TestReader:
  61. sample_transforms:
  62. - Decode: {}
  63. - Resize: {target_size: [800, 1333], keep_ratio: True, interp: 1}
  64. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  65. - Permute: {}
  66. batch_transforms:
  67. - PadBatch: {pad_to_stride: 128}
  68. batch_size: 1
  69. fuse_normalize: True
  70. # Model
  71. architecture: FCOS
  72. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
  73. FCOS:
  74. backbone: ResNet
  75. neck: FPN
  76. fcos_head: FCOSHead
  77. ResNet:
  78. depth: 50
  79. variant: 'b'
  80. norm_type: bn
  81. freeze_at: 0 # res2
  82. return_idx: [1, 2, 3]
  83. num_stages: 4
  84. FPN:
  85. out_channel: 256
  86. spatial_scales: [0.125, 0.0625, 0.03125]
  87. extra_stage: 2
  88. has_extra_convs: True
  89. use_c5: False
  90. FCOSHead:
  91. fcos_feat:
  92. name: FCOSFeat
  93. feat_in: 256
  94. feat_out: 256
  95. num_convs: 4
  96. norm_type: "gn"
  97. use_dcn: False
  98. fpn_stride: [8, 16, 32, 64, 128]
  99. prior_prob: 0.01
  100. norm_reg_targets: True
  101. centerness_on_reg: True
  102. num_shift: 0.5
  103. fcos_loss:
  104. name: FCOSLoss
  105. loss_alpha: 0.25
  106. loss_gamma: 2.0
  107. iou_loss_type: "giou"
  108. reg_weights: 1.0
  109. nms:
  110. name: MultiClassNMS
  111. nms_top_k: 1000
  112. keep_top_k: 100
  113. score_threshold: 0.025
  114. nms_threshold: 0.6
  115. # Optimizer
  116. epoch: 12
  117. LearningRate:
  118. base_lr: 0.01
  119. schedulers:
  120. - !PiecewiseDecay
  121. gamma: 0.1
  122. milestones: [8, 11]
  123. - !LinearWarmup
  124. start_factor: 0.3333333333333333
  125. steps: 500
  126. OptimizerBuilder:
  127. optimizer:
  128. momentum: 0.9
  129. type: Momentum
  130. regularizer:
  131. factor: 0.0001
  132. type: L2
  133. # Exporting the model
  134. export:
  135. post_process: True # Whether post-processing is included in the network when export model.
  136. nms: True # Whether NMS is included in the network when export model.
  137. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  138. fuse_conv_bn: False