PP-YOLOE_seg-S.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. epoch: 80
  2. use_gpu: true
  3. use_xpu: false
  4. use_mlu: false
  5. use_npu: false
  6. log_iter: 20
  7. save_dir: output
  8. target_metrics: mask
  9. snapshot_epoch: 1
  10. print_flops: false
  11. print_params: false
  12. worker_num: 4
  13. eval_height: &eval_height 640
  14. eval_width: &eval_width 640
  15. eval_size: &eval_size [*eval_height, *eval_width]
  16. # Dataset
  17. metric: COCO
  18. num_classes: 80
  19. TrainDataset:
  20. name: COCODataSet
  21. image_dir: train2017
  22. anno_path: annotations/instances_train2017.json
  23. dataset_dir: dataset/coco
  24. data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_poly', 'is_crowd']
  25. EvalDataset:
  26. name: COCODataSet
  27. image_dir: val2017
  28. anno_path: annotations/instances_val2017.json
  29. dataset_dir: dataset/coco
  30. TestDataset:
  31. name: ImageFolder
  32. anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  33. dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
  34. TrainReader:
  35. sample_transforms:
  36. - Decode: {}
  37. - RandomDistort: {}
  38. - RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
  39. - RandomCrop: {is_mask_crop: True}
  40. - RandomFlip: {}
  41. - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
  42. - Poly2Mask: {del_poly: True}
  43. batch_transforms:
  44. - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
  45. - Permute: {}
  46. - PadGT: {}
  47. batch_size: 8
  48. shuffle: true
  49. drop_last: true
  50. use_shared_memory: true
  51. collate_batch: False
  52. EvalReader:
  53. sample_transforms:
  54. - Decode: {}
  55. - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
  56. - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
  57. - Permute: {}
  58. batch_size: 1
  59. TestReader:
  60. inputs_def:
  61. image_shape: [3, *eval_height, *eval_width]
  62. sample_transforms:
  63. - Decode: {}
  64. - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
  65. - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
  66. - Permute: {}
  67. batch_size: 1
  68. LearningRate:
  69. base_lr: 0.001
  70. schedulers:
  71. - name: CosineDecay
  72. max_epochs: 96
  73. - name: LinearWarmup
  74. start_factor: 0.
  75. epochs: 5
  76. OptimizerBuilder:
  77. optimizer:
  78. momentum: 0.9
  79. type: Momentum
  80. regularizer:
  81. factor: 0.0005
  82. type: L2
  83. # Model
  84. architecture: PPYOLOE
  85. pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/ppyoloe_crn_s_obj365_pretrained.pdparams
  86. norm_type: sync_bn
  87. use_ema: true
  88. ema_decay: 0.9998
  89. ema_black_list: ['proj_conv.weight']
  90. custom_black_list: ['reduce_mean']
  91. depth_mult: 0.33
  92. width_mult: 0.50
  93. with_mask: True
  94. PPYOLOE:
  95. backbone: CSPResNet
  96. neck: CustomCSPPAN
  97. yolo_head: PPYOLOEInsHead
  98. post_process: ~
  99. with_mask: True
  100. CSPResNet:
  101. layers: [3, 6, 6, 3]
  102. channels: [64, 128, 256, 512, 1024]
  103. return_idx: [1, 2, 3]
  104. use_large_stem: True
  105. use_alpha: True
  106. CustomCSPPAN:
  107. out_channels: [768, 384, 192]
  108. stage_num: 1
  109. block_num: 3
  110. act: 'swish'
  111. spp: true
  112. PPYOLOEInsHead:
  113. fpn_strides: [32, 16, 8]
  114. grid_cell_scale: 5.0
  115. grid_cell_offset: 0.5
  116. static_assigner_epoch: -1 # only use TaskAlignedAssigner
  117. use_varifocal_loss: True
  118. loss_weight: {class: 1.0, iou: 2.5, dfl: 0.5}
  119. assigner:
  120. name: TaskAlignedAssigner
  121. topk: 13
  122. alpha: 1.0
  123. beta: 6.0
  124. nms:
  125. name: MultiClassNMS
  126. nms_top_k: 1000
  127. keep_top_k: 300
  128. score_threshold: 0.01
  129. nms_threshold: 0.7
  130. return_index: True
  131. # Exporting the model
  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