YOLOv3-ResNet50_vd_DCN.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # Runtime
  2. epoch: 270
  3. use_gpu: true
  4. use_xpu: false
  5. use_mlu: false
  6. use_npu: false
  7. use_ema: True
  8. log_iter: 20
  9. save_dir: output
  10. snapshot_epoch: 1
  11. print_flops: false
  12. print_params: false
  13. # Dataset
  14. metric: COCO
  15. num_classes: 80
  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', 'is_crowd']
  22. EvalDataset:
  23. name: COCODataSet
  24. image_dir: val2017
  25. anno_path: annotations/instances_val2017.json
  26. dataset_dir: dataset/coco
  27. allow_empty: true
  28. TestDataset:
  29. name: ImageFolder
  30. anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  31. dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
  32. worker_num: 2
  33. TrainReader:
  34. inputs_def:
  35. num_max_boxes: 50
  36. sample_transforms:
  37. - Decode: {}
  38. - Mixup: {alpha: 1.5, beta: 1.5}
  39. - RandomDistort: {}
  40. - RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
  41. - RandomCrop: {}
  42. - RandomFlip: {}
  43. batch_transforms:
  44. - BatchRandomResize: {target_size: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608], random_size: True, random_interp: True, keep_ratio: False}
  45. - NormalizeBox: {}
  46. - PadBox: {num_max_boxes: 50}
  47. - BboxXYXY2XYWH: {}
  48. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  49. - Permute: {}
  50. - Gt2YoloTarget: {anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]], anchors: [[10, 13], [16, 30], [33, 23], [30, 61], [62, 45], [59, 119], [116, 90], [156, 198], [373, 326]], downsample_ratios: [32, 16, 8]}
  51. batch_size: 8
  52. shuffle: true
  53. drop_last: true
  54. mixup_epoch: 250
  55. use_shared_memory: true
  56. EvalReader:
  57. inputs_def:
  58. num_max_boxes: 50
  59. sample_transforms:
  60. - Decode: {}
  61. - Resize: {target_size: [608, 608], keep_ratio: False, interp: 2}
  62. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  63. - Permute: {}
  64. batch_size: 1
  65. TestReader:
  66. inputs_def:
  67. image_shape: [3, 608, 608]
  68. sample_transforms:
  69. - Decode: {}
  70. - Resize: {target_size: [608, 608], keep_ratio: False, interp: 2}
  71. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  72. - Permute: {}
  73. batch_size: 1
  74. # Model
  75. architecture: YOLOv3
  76. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_vd_ssld_pretrained.pdparams
  77. norm_type: sync_bn
  78. YOLOv3:
  79. backbone: ResNet
  80. neck: YOLOv3FPN
  81. yolo_head: YOLOv3Head
  82. post_process: BBoxPostProcess
  83. ResNet:
  84. depth: 50
  85. variant: d
  86. return_idx: [1, 2, 3]
  87. dcn_v2_stages: [3]
  88. freeze_at: -1
  89. freeze_norm: false
  90. norm_decay: 0.
  91. # YOLOv3FPN:
  92. YOLOv3Head:
  93. anchors: [[10, 13], [16, 30], [33, 23],
  94. [30, 61], [62, 45], [59, 119],
  95. [116, 90], [156, 198], [373, 326]]
  96. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  97. loss: YOLOv3Loss
  98. YOLOv3Loss:
  99. ignore_thresh: 0.7
  100. downsample: [32, 16, 8]
  101. label_smooth: false
  102. BBoxPostProcess:
  103. decode:
  104. name: YOLOBox
  105. conf_thresh: 0.005
  106. downsample_ratio: 32
  107. clip_bbox: true
  108. nms:
  109. name: MultiClassNMS
  110. keep_top_k: 100
  111. score_threshold: 0.01
  112. nms_threshold: 0.45
  113. nms_top_k: 1000
  114. # Optimizer
  115. LearningRate:
  116. base_lr: 0.001
  117. schedulers:
  118. - !PiecewiseDecay
  119. gamma: 0.1
  120. milestones:
  121. - 216
  122. - 243
  123. - !LinearWarmup
  124. start_factor: 0.
  125. steps: 4000
  126. OptimizerBuilder:
  127. optimizer:
  128. momentum: 0.9
  129. type: Momentum
  130. regularizer:
  131. factor: 0.0005
  132. type: L2
  133. # Export
  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