BlazeFace.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # Runtime
  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. print_flops: false
  9. print_params: false
  10. weights: output/blazeface_1000e/model_final
  11. snapshot_epoch: 10
  12. # Model
  13. architecture: BlazeFace
  14. BlazeFace:
  15. backbone: BlazeNet
  16. neck: BlazeNeck
  17. blaze_head: FaceHead
  18. post_process: BBoxPostProcess
  19. BlazeNet:
  20. blaze_filters: [[24, 24], [24, 24], [24, 48, 2], [48, 48], [48, 48]]
  21. double_blaze_filters: [[48, 24, 96, 2], [96, 24, 96], [96, 24, 96],
  22. [96, 24, 96, 2], [96, 24, 96], [96, 24, 96]]
  23. act: relu
  24. BlazeNeck:
  25. neck_type : None
  26. in_channel: [96,96]
  27. FaceHead:
  28. in_channels: [96,96]
  29. anchor_generator: AnchorGeneratorSSD
  30. loss: SSDLoss
  31. SSDLoss:
  32. overlap_threshold: 0.35
  33. AnchorGeneratorSSD:
  34. steps: [8., 16.]
  35. aspect_ratios: [[1.], [1.]]
  36. min_sizes: [[16.,24.], [32., 48., 64., 80., 96., 128.]]
  37. max_sizes: [[], []]
  38. offset: 0.5
  39. flip: False
  40. min_max_aspect_ratios_order: false
  41. BBoxPostProcess:
  42. decode:
  43. name: SSDBox
  44. nms:
  45. name: MultiClassNMS
  46. keep_top_k: 750
  47. score_threshold: 0.01
  48. nms_threshold: 0.3
  49. nms_top_k: 5000
  50. nms_eta: 1.0
  51. # Optimizer
  52. epoch: 1000
  53. LearningRate:
  54. base_lr: 0.001
  55. schedulers:
  56. - !PiecewiseDecay
  57. gamma: 0.1
  58. milestones:
  59. - 333
  60. - 800
  61. - !LinearWarmup
  62. start_factor: 0.3333333333333333
  63. steps: 500
  64. OptimizerBuilder:
  65. optimizer:
  66. momentum: 0.0
  67. type: RMSProp
  68. regularizer:
  69. factor: 0.0005
  70. type: L2
  71. # Dataset
  72. metric: WiderFace
  73. num_classes: 1
  74. TrainDataset:
  75. name: COCODataSet
  76. image_dir: WIDER_train/images
  77. anno_path: train.json
  78. dataset_dir: data_face
  79. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  80. EvalDataset:
  81. name: COCODataSet
  82. image_dir: WIDER_val/images
  83. anno_path: val.json
  84. dataset_dir: data_face
  85. allow_empty: true
  86. TestDataset:
  87. name: COCODataSet
  88. image_dir: WIDER_val/images
  89. anno_path: val.json
  90. dataset_dir: data_face
  91. # Reader
  92. worker_num: 8
  93. TrainReader:
  94. inputs_def:
  95. num_max_boxes: 90
  96. sample_transforms:
  97. - Decode: {}
  98. - RandomDistort: {brightness: [0.5, 1.125, 0.875], random_apply: False}
  99. - RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
  100. - RandomFlip: {}
  101. - CropWithDataAchorSampling: {
  102. anchor_sampler: [[1, 10, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.2, 0.0]],
  103. batch_sampler: [
  104. [1, 50, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0],
  105. [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0],
  106. [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0],
  107. [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0],
  108. [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0],
  109. ],
  110. target_size: 640}
  111. - Resize: {target_size: [640, 640], keep_ratio: False, interp: 1}
  112. - NormalizeBox: {}
  113. - PadBox: {num_max_boxes: 90}
  114. batch_transforms:
  115. - NormalizeImage: {mean: [123, 117, 104], std: [127.502231, 127.502231, 127.502231], is_scale: false}
  116. - Permute: {}
  117. batch_size: 16
  118. shuffle: true
  119. drop_last: true
  120. EvalReader:
  121. sample_transforms:
  122. - Decode: {}
  123. - NormalizeImage: {mean: [123, 117, 104], std: [127.502231, 127.502231, 127.502231], is_scale: false}
  124. - Permute: {}
  125. batch_size: 1
  126. collate_samples: false
  127. shuffle: false
  128. drop_last: false
  129. TestReader:
  130. sample_transforms:
  131. - Decode: {}
  132. - NormalizeImage: {mean: [123, 117, 104], std: [127.502231, 127.502231, 127.502231], is_scale: false}
  133. - Permute: {}
  134. batch_size: 1
  135. # Exporting the model
  136. export:
  137. post_process: True # Whether post-processing is included in the network when export model.
  138. nms: True # Whether NMS is included in the network when export model.
  139. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  140. fuse_conv_bn: False