PP-HGNetV2-B4_ML.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # global configs
  2. Global:
  3. checkpoints: null
  4. pretrained_model: null
  5. output_dir: ./output/
  6. device: gpu
  7. save_interval: 10
  8. eval_during_train: True
  9. eval_interval: 1
  10. epochs: 40
  11. print_batch_step: 10
  12. use_visualdl: False
  13. # used for static mode and model export
  14. image_shape: [3, 448, 448]
  15. save_inference_dir: ./inference
  16. # training model under @to_static
  17. to_static: False
  18. use_multilabel: True
  19. # mixed precision
  20. AMP:
  21. use_amp: True
  22. use_fp16_test: False
  23. scale_loss: 128.0
  24. use_dynamic_loss_scaling: True
  25. use_promote: False
  26. # O1: mixed fp16, O2: pure fp16
  27. level: O1
  28. # model architecture
  29. Arch:
  30. name: PPHGNetV2_B4
  31. class_num: 80
  32. pretrained: True # ssld pretrained
  33. use_ml_decoder: True
  34. # ml-decoder head
  35. MLDecoder:
  36. query_num: 80 # default: 80, query_num <= class_num
  37. in_channels: 2048
  38. # loss function config for training/eval process
  39. Loss:
  40. Train:
  41. - MultiLabelAsymmetricLoss:
  42. weight: 1.0
  43. gamma_pos: 0
  44. gamma_neg: 4
  45. clip: 0.05
  46. disable_focal_loss_grad: True
  47. Eval:
  48. - MultiLabelAsymmetricLoss:
  49. weight: 1.0
  50. gamma_pos: 0
  51. gamma_neg: 4
  52. clip: 0.05
  53. disable_focal_loss_grad: True
  54. Optimizer:
  55. name: AdamW
  56. beta1: 0.9
  57. beta2: 0.999
  58. epsilon: 1e-8
  59. weight_decay: 1e-4
  60. one_dim_param_no_weight_decay: True
  61. lr:
  62. name: Cosine
  63. learning_rate: 1e-4
  64. eta_min: 1e-10
  65. warmup_epoch: 5
  66. warmup_start_lr: 1e-6
  67. # data loader for train and eval
  68. DataLoader:
  69. Train:
  70. dataset:
  71. name: MultiLabelDataset
  72. image_root: dataset/coco_ml/images
  73. cls_label_path: dataset/coco_ml/train.txt
  74. transform_ops:
  75. - DecodeImage:
  76. to_rgb: True
  77. channel_first: False
  78. - ResizeImage:
  79. size: 448
  80. interpolation: bilinear
  81. backend: pil
  82. - Cutout:
  83. length: 224
  84. fill_value: none
  85. - RandAugmentV4:
  86. - NormalizeImage:
  87. scale: 1.0/255.0
  88. mean: [0.485, 0.456, 0.406]
  89. std: [0.229, 0.224, 0.225]
  90. order: ''
  91. sampler:
  92. name: DistributedBatchSampler
  93. batch_size: 64
  94. drop_last: False
  95. shuffle: True
  96. loader:
  97. num_workers: 8
  98. use_shared_memory: True
  99. Eval:
  100. dataset:
  101. name: MultiLabelDataset
  102. image_root: dataset/coco_ml/images
  103. cls_label_path: dataset/coco_ml/val.txt
  104. transform_ops:
  105. - DecodeImage:
  106. to_rgb: True
  107. channel_first: False
  108. - ResizeImage:
  109. size: 448
  110. interpolation: bilinear
  111. backend: pil
  112. - NormalizeImage:
  113. scale: 1.0/255.0
  114. mean: [0.485, 0.456, 0.406]
  115. std: [0.229, 0.224, 0.225]
  116. order: ''
  117. sampler:
  118. name: DistributedBatchSampler
  119. batch_size: 16
  120. drop_last: False
  121. shuffle: False
  122. loader:
  123. num_workers: 8
  124. use_shared_memory: True
  125. Infer:
  126. infer_imgs: deploy/images/coco_000000570688.jpg
  127. batch_size: 10
  128. transforms:
  129. - DecodeImage:
  130. to_rgb: True
  131. channel_first: False
  132. - ResizeImage:
  133. size: 448
  134. interpolation: bilinear
  135. backend: pil
  136. - NormalizeImage:
  137. scale: 1.0/255.0
  138. mean: [0.485, 0.456, 0.406]
  139. std: [0.229, 0.224, 0.225]
  140. order: ''
  141. - ToCHWImage:
  142. PostProcess:
  143. name: MultiLabelThreshOutput
  144. threshold: 0.5
  145. class_id_map_file: dataset/coco_ml/label.txt
  146. Metric:
  147. Train:
  148. Eval:
  149. - MultiLabelMAP:
  150. # support list: integral, 11point
  151. # default: integral
  152. map_type: integral