YOLOv3-ResNet50_vd_DCN.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # Runtime
  2. epoch: 270
  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. worker_num: 2
  32. TrainReader:
  33. inputs_def:
  34. num_max_boxes: 50
  35. sample_transforms:
  36. - Decode: {}
  37. - Mixup: {alpha: 1.5, beta: 1.5}
  38. - RandomDistort: {}
  39. - RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
  40. - RandomCrop: {}
  41. - RandomFlip: {}
  42. batch_transforms:
  43. - BatchRandomResize: {target_size: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608], random_size: True, random_interp: True, keep_ratio: False}
  44. - NormalizeBox: {}
  45. - PadBox: {num_max_boxes: 50}
  46. - BboxXYXY2XYWH: {}
  47. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  48. - Permute: {}
  49. - 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]}
  50. batch_size: 8
  51. shuffle: true
  52. drop_last: true
  53. mixup_epoch: 250
  54. use_shared_memory: true
  55. EvalReader:
  56. inputs_def:
  57. num_max_boxes: 50
  58. sample_transforms:
  59. - Decode: {}
  60. - Resize: {target_size: [608, 608], keep_ratio: False, interp: 2}
  61. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  62. - Permute: {}
  63. batch_size: 1
  64. TestReader:
  65. inputs_def:
  66. image_shape: [3, 608, 608]
  67. sample_transforms:
  68. - Decode: {}
  69. - Resize: {target_size: [608, 608], keep_ratio: False, interp: 2}
  70. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  71. - Permute: {}
  72. batch_size: 1
  73. # Model
  74. architecture: YOLOv3
  75. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_vd_ssld_pretrained.pdparams
  76. norm_type: sync_bn
  77. YOLOv3:
  78. backbone: ResNet
  79. neck: YOLOv3FPN
  80. yolo_head: YOLOv3Head
  81. post_process: BBoxPostProcess
  82. ResNet:
  83. depth: 50
  84. variant: d
  85. return_idx: [1, 2, 3]
  86. dcn_v2_stages: [3]
  87. freeze_at: -1
  88. freeze_norm: false
  89. norm_decay: 0.
  90. # YOLOv3FPN:
  91. YOLOv3Head:
  92. anchors: [[10, 13], [16, 30], [33, 23],
  93. [30, 61], [62, 45], [59, 119],
  94. [116, 90], [156, 198], [373, 326]]
  95. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  96. loss: YOLOv3Loss
  97. YOLOv3Loss:
  98. ignore_thresh: 0.7
  99. downsample: [32, 16, 8]
  100. label_smooth: false
  101. BBoxPostProcess:
  102. decode:
  103. name: YOLOBox
  104. conf_thresh: 0.005
  105. downsample_ratio: 32
  106. clip_bbox: true
  107. nms:
  108. name: MultiClassNMS
  109. keep_top_k: 100
  110. score_threshold: 0.01
  111. nms_threshold: 0.45
  112. nms_top_k: 1000
  113. # Optimizer
  114. LearningRate:
  115. base_lr: 0.001
  116. schedulers:
  117. - !PiecewiseDecay
  118. gamma: 0.1
  119. milestones:
  120. - 216
  121. - 243
  122. - !LinearWarmup
  123. start_factor: 0.
  124. steps: 4000
  125. OptimizerBuilder:
  126. optimizer:
  127. momentum: 0.9
  128. type: Momentum
  129. regularizer:
  130. factor: 0.0005
  131. type: L2
  132. # Export
  133. export:
  134. post_process: True # Whether post-processing is included in the network when export model.
  135. nms: True # Whether NMS is included in the network when export model.
  136. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  137. fuse_conv_bn: False