ppyoloe_crn_m_300e_battery_1024.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. weights: output/ppyoloe_crn_m_300e_battery_1024/model_final
  2. pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_m_300e_coco.pdparams
  3. depth_mult: 0.67
  4. width_mult: 0.75
  5. worker_num: 4
  6. eval_height: &eval_height 1024
  7. eval_width: &eval_width 1024
  8. eval_size: &eval_size [*eval_height, *eval_width]
  9. metric: COCO
  10. num_classes: 45
  11. TrainDataset:
  12. !COCODataSet
  13. image_dir: images
  14. anno_path: annotations/train.json
  15. dataset_dir: dataset/battery_mini
  16. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  17. EvalDataset:
  18. !COCODataSet
  19. image_dir: images
  20. anno_path: annotations/test.json
  21. dataset_dir: dataset/battery_mini
  22. TestDataset:
  23. !ImageFolder
  24. anno_path: annotations/test.json
  25. dataset_dir: dataset/battery_mini
  26. epoch: 30
  27. LearningRate:
  28. base_lr: 0.0005
  29. schedulers:
  30. - !CosineDecay
  31. max_epochs: 36
  32. - !LinearWarmup
  33. start_factor: 0.
  34. epochs: 3
  35. TrainReader:
  36. sample_transforms:
  37. - Decode: {}
  38. - RandomFlip: {}
  39. batch_transforms:
  40. - BatchRandomResize: {target_size: [960, 992, 1024, 1056, 1088], random_size: True, random_interp: True, keep_ratio: False}
  41. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  42. - Permute: {}
  43. - PadGT: {}
  44. batch_size: 4
  45. shuffle: true
  46. drop_last: true
  47. use_shared_memory: true
  48. collate_batch: true
  49. EvalReader:
  50. sample_transforms:
  51. - Decode: {}
  52. - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
  53. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  54. - Permute: {}
  55. batch_size: 1
  56. TestReader:
  57. inputs_def:
  58. image_shape: [3, *eval_height, *eval_width]
  59. sample_transforms:
  60. - Decode: {}
  61. - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
  62. - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
  63. - Permute: {}
  64. batch_size: 1
  65. use_gpu: true
  66. use_xpu: false
  67. log_iter: 100
  68. save_dir: output
  69. snapshot_epoch: 5
  70. print_flops: false
  71. # Exporting the model
  72. export:
  73. post_process: True # Whether post-processing is included in the network when export model.
  74. nms: True # Whether NMS is included in the network when export model.
  75. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  76. OptimizerBuilder:
  77. optimizer:
  78. momentum: 0.9
  79. type: Momentum
  80. regularizer:
  81. factor: 0.0005
  82. type: L2
  83. architecture: YOLOv3
  84. norm_type: sync_bn
  85. use_ema: true
  86. ema_decay: 0.9998
  87. YOLOv3:
  88. backbone: CSPResNet
  89. neck: CustomCSPPAN
  90. yolo_head: PPYOLOEHead
  91. post_process: ~
  92. CSPResNet:
  93. layers: [3, 6, 6, 3]
  94. channels: [64, 128, 256, 512, 1024]
  95. return_idx: [1, 2, 3]
  96. use_large_stem: True
  97. CustomCSPPAN:
  98. out_channels: [768, 384, 192]
  99. stage_num: 1
  100. block_num: 3
  101. act: 'swish'
  102. spp: true
  103. PPYOLOEHead:
  104. fpn_strides: [32, 16, 8]
  105. grid_cell_scale: 5.0
  106. grid_cell_offset: 0.5
  107. static_assigner_epoch: 100
  108. use_varifocal_loss: True
  109. loss_weight: {class: 1.0, iou: 2.5, dfl: 0.5}
  110. static_assigner:
  111. name: ATSSAssigner
  112. topk: 9
  113. assigner:
  114. name: TaskAlignedAssigner
  115. topk: 13
  116. alpha: 1.0
  117. beta: 6.0
  118. nms:
  119. name: MultiClassNMS
  120. nms_top_k: 1000
  121. keep_top_k: 100
  122. score_threshold: 0.01
  123. nms_threshold: 0.6