YOLOv3-MobileNetV3.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. 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/MobileNetV3_large_x1_0_ssld_pretrained.pdparams
  76. norm_type: sync_bn
  77. YOLOv3:
  78. backbone: MobileNetV3
  79. neck: YOLOv3FPN
  80. yolo_head: YOLOv3Head
  81. post_process: BBoxPostProcess
  82. MobileNetV3:
  83. model_name: large
  84. scale: 1.
  85. with_extra_blocks: false
  86. extra_block_filters: []
  87. feature_maps: [7, 13, 16]
  88. # use default config
  89. # YOLOv3FPN:
  90. YOLOv3Head:
  91. anchors: [[10, 13], [16, 30], [33, 23],
  92. [30, 61], [62, 45], [59, 119],
  93. [116, 90], [156, 198], [373, 326]]
  94. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  95. loss: YOLOv3Loss
  96. YOLOv3Loss:
  97. ignore_thresh: 0.7
  98. downsample: [32, 16, 8]
  99. label_smooth: false
  100. BBoxPostProcess:
  101. decode:
  102. name: YOLOBox
  103. conf_thresh: 0.005
  104. downsample_ratio: 32
  105. clip_bbox: true
  106. nms:
  107. name: MultiClassNMS
  108. keep_top_k: 100
  109. score_threshold: 0.01
  110. nms_threshold: 0.45
  111. nms_top_k: 1000
  112. # Optimizer
  113. LearningRate:
  114. base_lr: 0.001
  115. schedulers:
  116. - !PiecewiseDecay
  117. gamma: 0.1
  118. milestones:
  119. - 216
  120. - 243
  121. - !LinearWarmup
  122. start_factor: 0.
  123. steps: 4000
  124. OptimizerBuilder:
  125. optimizer:
  126. momentum: 0.9
  127. type: Momentum
  128. regularizer:
  129. factor: 0.0005
  130. type: L2
  131. # Export
  132. export:
  133. post_process: True # Whether post-processing is included in the network when export model.
  134. nms: True # Whether NMS is included in the network when export model.
  135. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  136. fuse_conv_bn: False