ppyolo_roadsign_kunlun.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. architecture: YOLOv3
  2. use_gpu: false
  3. use_xpu: true
  4. max_iters: 5000
  5. log_iter: 1
  6. save_dir: output
  7. snapshot_iter: 500
  8. metric: VOC
  9. pretrain_weights: https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams
  10. weights: output/ppyolo_roadsign_kunlun/model_final
  11. num_classes: 4
  12. finetune_exclude_pretrained_params: ['yolo_output']
  13. use_fine_grained_loss: true
  14. use_ema: true
  15. ema_decay: 0.9998
  16. YOLOv3:
  17. backbone: ResNet
  18. yolo_head: YOLOv3Head
  19. use_fine_grained_loss: true
  20. ResNet:
  21. norm_type: 'bn'
  22. freeze_at: 0
  23. freeze_norm: false
  24. norm_decay: 0.
  25. depth: 50
  26. feature_maps: [3, 4, 5]
  27. variant: d
  28. dcn_v2_stages: [5]
  29. YOLOv3Head:
  30. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  31. anchors: [[10, 13], [16, 30], [33, 23],
  32. [30, 61], [62, 45], [59, 119],
  33. [116, 90], [156, 198], [373, 326]]
  34. norm_decay: 0.
  35. coord_conv: true
  36. iou_aware: true
  37. iou_aware_factor: 0.4
  38. scale_x_y: 1.05
  39. spp: true
  40. yolo_loss: YOLOv3Loss
  41. nms: MatrixNMS
  42. drop_block: true
  43. YOLOv3Loss:
  44. ignore_thresh: 0.7
  45. scale_x_y: 1.05
  46. label_smooth: false
  47. use_fine_grained_loss: true
  48. iou_loss: IouLoss
  49. iou_aware_loss: IouAwareLoss
  50. IouLoss:
  51. loss_weight: 2.5
  52. max_height: 608
  53. max_width: 608
  54. IouAwareLoss:
  55. loss_weight: 1.0
  56. max_height: 608
  57. max_width: 608
  58. MatrixNMS:
  59. background_label: -1
  60. keep_top_k: 100
  61. normalized: false
  62. score_threshold: 0.01
  63. post_threshold: 0.01
  64. LearningRate:
  65. base_lr: 0.0001
  66. schedulers:
  67. - !PiecewiseDecay
  68. gamma: 0.1
  69. milestones:
  70. - 800
  71. - 110
  72. - !LinearWarmup
  73. start_factor: 0
  74. steps: 100
  75. OptimizerBuilder:
  76. optimizer:
  77. momentum: 0.9
  78. type: Momentum
  79. regularizer:
  80. factor: 0.0005
  81. type: L2
  82. TrainReader:
  83. inputs_def:
  84. fields: ['image', 'gt_bbox', 'gt_class', 'gt_score']
  85. num_max_boxes: 50
  86. dataset:
  87. !VOCDataSet
  88. dataset_dir: dataset/roadsign_voc
  89. anno_path: train.txt
  90. with_background: false
  91. sample_transforms:
  92. - !DecodeImage
  93. to_rgb: True
  94. with_mixup: True
  95. - !MixupImage
  96. alpha: 1.5
  97. beta: 1.5
  98. - !ColorDistort {}
  99. - !RandomExpand
  100. fill_value: [123.675, 116.28, 103.53]
  101. ratio: 1.5
  102. - !RandomCrop {}
  103. - !RandomFlipImage
  104. is_normalized: false
  105. - !NormalizeBox {}
  106. - !PadBox
  107. num_max_boxes: 50
  108. - !BboxXYXY2XYWH {}
  109. batch_transforms:
  110. - !RandomShape
  111. sizes: [320]
  112. random_inter: True
  113. - !NormalizeImage
  114. mean: [0.485, 0.456, 0.406]
  115. std: [0.229, 0.224, 0.225]
  116. is_scale: True
  117. is_channel_first: false
  118. - !Permute
  119. to_bgr: false
  120. channel_first: True
  121. - !Gt2YoloTarget
  122. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  123. anchors: [[10, 13], [16, 30], [33, 23],
  124. [30, 61], [62, 45], [59, 119],
  125. [116, 90], [156, 198], [373, 326]]
  126. downsample_ratios: [32, 16, 8]
  127. batch_size: 8
  128. shuffle: true
  129. mixup_epoch: 250
  130. drop_last: true
  131. worker_num: 2
  132. bufsize: 2
  133. use_process: false #true
  134. EvalReader:
  135. inputs_def:
  136. fields: ['image', 'im_size', 'im_id', 'gt_bbox', 'gt_class', 'is_difficult']
  137. num_max_boxes: 50
  138. dataset:
  139. !VOCDataSet
  140. dataset_dir: dataset/roadsign_voc
  141. anno_path: valid.txt
  142. with_background: false
  143. sample_transforms:
  144. - !DecodeImage
  145. to_rgb: True
  146. - !ResizeImage
  147. target_size: 608
  148. interp: 2
  149. - !NormalizeImage
  150. mean: [0.485, 0.456, 0.406]
  151. std: [0.229, 0.224, 0.225]
  152. is_scale: True
  153. is_channel_first: false
  154. - !PadBox
  155. num_max_boxes: 50
  156. - !Permute
  157. to_bgr: false
  158. channel_first: True
  159. batch_size: 1
  160. drop_empty: false
  161. worker_num: 4
  162. bufsize: 2
  163. TestReader:
  164. inputs_def:
  165. image_shape: [3, 608, 608]
  166. fields: ['image', 'im_size', 'im_id']
  167. dataset:
  168. !ImageFolder
  169. anno_path: dataset/roadsign_voc/label_list.txt
  170. with_background: false
  171. sample_transforms:
  172. - !DecodeImage
  173. to_rgb: True
  174. - !ResizeImage
  175. target_size: 608
  176. interp: 2
  177. - !NormalizeImage
  178. mean: [0.485, 0.456, 0.406]
  179. std: [0.229, 0.224, 0.225]
  180. is_scale: True
  181. is_channel_first: false
  182. - !Permute
  183. to_bgr: false
  184. channel_first: True
  185. batch_size: 1