YOLOv3-DarkNet53.yaml 3.7 KB

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