ppyolov2_r50vd_dcn_365e_battery_1024.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. architecture: YOLOv3
  2. pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyolov2_r50vd_dcn_365e_coco.pdparams
  3. norm_type: sync_bn
  4. use_ema: true
  5. ema_decay: 0.9998
  6. use_gpu: true
  7. use_xpu: false
  8. log_iter: 100
  9. save_dir: output
  10. metric: COCO
  11. num_classes: 45
  12. TrainDataset:
  13. !COCODataSet
  14. image_dir: images
  15. anno_path: annotations/train.json
  16. dataset_dir: dataset/battery_mini
  17. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  18. EvalDataset:
  19. !COCODataSet
  20. image_dir: images
  21. anno_path: annotations/test.json
  22. dataset_dir: dataset/battery_mini
  23. TestDataset:
  24. !ImageFolder
  25. anno_path: annotations/test.json # also support txt (like VOC's label_list.txt)
  26. dataset_dir: dataset/battery_mini # if set, anno_path will be 'dataset_dir/anno_path'
  27. epoch: 40
  28. LearningRate:
  29. base_lr: 0.0001
  30. schedulers:
  31. - !PiecewiseDecay
  32. gamma: 0.1
  33. milestones:
  34. - 80
  35. - !LinearWarmup
  36. start_factor: 0.
  37. steps: 1000
  38. snapshot_epoch: 5
  39. worker_num: 2
  40. TrainReader:
  41. inputs_def:
  42. num_max_boxes: 100
  43. sample_transforms:
  44. - Decode: {}
  45. - RandomDistort: {}
  46. - RandomFlip: {}
  47. batch_transforms:
  48. - BatchRandomResize: {target_size: [960, 992, 1024, 1056, 1088], random_size: True, random_interp: True, keep_ratio: False}
  49. - NormalizeBox: {}
  50. - PadBox: {num_max_boxes: 100}
  51. - BboxXYXY2XYWH: {}
  52. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  53. - Permute: {}
  54. - 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]}
  55. batch_size: 4
  56. shuffle: true
  57. drop_last: true
  58. use_shared_memory: true
  59. EvalReader:
  60. sample_transforms:
  61. - Decode: {}
  62. - Resize: {target_size: [1024, 1024], keep_ratio: False, interp: 2}
  63. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  64. - Permute: {}
  65. batch_size: 8
  66. TestReader:
  67. inputs_def:
  68. image_shape: [3, 1024, 1024]
  69. sample_transforms:
  70. - Decode: {}
  71. - Resize: {target_size: [1024, 1024], keep_ratio: False, interp: 2}
  72. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  73. - Permute: {}
  74. batch_size: 1
  75. OptimizerBuilder:
  76. clip_grad_by_norm: 35.
  77. optimizer:
  78. momentum: 0.9
  79. type: Momentum
  80. regularizer:
  81. factor: 0.0005
  82. type: L2
  83. YOLOv3:
  84. backbone: ResNet
  85. neck: PPYOLOPAN
  86. yolo_head: YOLOv3Head
  87. post_process: BBoxPostProcess
  88. ResNet:
  89. depth: 50
  90. variant: d
  91. return_idx: [1, 2, 3]
  92. dcn_v2_stages: [3]
  93. freeze_at: -1
  94. freeze_norm: false
  95. norm_decay: 0.
  96. PPYOLOPAN:
  97. drop_block: true
  98. block_size: 3
  99. keep_prob: 0.9
  100. spp: true
  101. YOLOv3Head:
  102. anchors: [[10, 13], [16, 30], [33, 23],
  103. [30, 61], [62, 45], [59, 119],
  104. [116, 90], [156, 198], [373, 326]]
  105. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  106. loss: YOLOv3Loss
  107. iou_aware: true
  108. iou_aware_factor: 0.4
  109. YOLOv3Loss:
  110. ignore_thresh: 0.7
  111. downsample: [32, 16, 8]
  112. label_smooth: false
  113. scale_x_y: 1.05
  114. iou_loss: IouLoss
  115. iou_aware_loss: IouAwareLoss
  116. IouLoss:
  117. loss_weight: 2.5
  118. loss_square: true
  119. IouAwareLoss:
  120. loss_weight: 1.0
  121. BBoxPostProcess:
  122. decode:
  123. name: YOLOBox
  124. conf_thresh: 0.01
  125. downsample_ratio: 32
  126. clip_bbox: true
  127. scale_x_y: 1.05
  128. nms:
  129. name: MatrixNMS
  130. keep_top_k: 100
  131. score_threshold: 0.01
  132. post_threshold: 0.01
  133. nms_top_k: -1
  134. background_label: -1