YOLOv3-DarkNet53.yaml 3.7 KB

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