yolov3_darknet_roadsign_kunlun.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. architecture: YOLOv3
  2. use_gpu: false
  3. use_xpu: true
  4. max_iters: 1200
  5. log_iter: 1
  6. save_dir: output
  7. snapshot_iter: 200
  8. metric: VOC
  9. map_type: integral
  10. pretrain_weights: https://paddlemodels.bj.bcebos.com/object_detection/yolov3_darknet.tar
  11. weights: output/yolov3_darknet_roadsign_xpu/model_final
  12. num_classes: 4
  13. finetune_exclude_pretrained_params: ['yolo_output']
  14. use_fine_grained_loss: false
  15. YOLOv3:
  16. backbone: DarkNet
  17. yolo_head: YOLOv3Head
  18. DarkNet:
  19. norm_type: bn
  20. norm_decay: 0.
  21. depth: 53
  22. YOLOv3Head:
  23. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  24. anchors: [[10, 13], [16, 30], [33, 23],
  25. [30, 61], [62, 45], [59, 119],
  26. [116, 90], [156, 198], [373, 326]]
  27. norm_decay: 0.
  28. yolo_loss: YOLOv3Loss
  29. nms:
  30. background_label: -1
  31. keep_top_k: 100
  32. nms_threshold: 0.45
  33. nms_top_k: 1000
  34. normalized: false
  35. score_threshold: 0.01
  36. YOLOv3Loss:
  37. ignore_thresh: 0.7
  38. label_smooth: true
  39. LearningRate:
  40. base_lr: 0.000125 #0.00025
  41. schedulers:
  42. - !PiecewiseDecay
  43. gamma: 0.1
  44. milestones:
  45. - 800 #400
  46. - 1100 #550
  47. - !LinearWarmup
  48. start_factor: 0.
  49. steps: 200 #200
  50. OptimizerBuilder:
  51. optimizer:
  52. momentum: 0.9
  53. type: Momentum
  54. regularizer:
  55. factor: 0.0005
  56. type: L2
  57. TrainReader:
  58. inputs_def:
  59. fields: ['image', 'gt_bbox', 'gt_class', 'gt_score']
  60. num_max_boxes: 50
  61. dataset:
  62. !VOCDataSet
  63. dataset_dir: dataset/roadsign_voc
  64. anno_path: train.txt
  65. with_background: false
  66. sample_transforms:
  67. - !DecodeImage
  68. to_rgb: True
  69. with_mixup: True
  70. - !MixupImage
  71. alpha: 1.5
  72. beta: 1.5
  73. - !ColorDistort {}
  74. - !RandomExpand
  75. fill_value: [123.675, 116.28, 103.53]
  76. ratio: 1.5
  77. - !RandomCrop {}
  78. - !RandomFlipImage
  79. is_normalized: false
  80. - !NormalizeBox {}
  81. - !PadBox
  82. num_max_boxes: 50
  83. - !BboxXYXY2XYWH {}
  84. batch_transforms:
  85. - !RandomShape
  86. sizes: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608]
  87. random_inter: True
  88. - !NormalizeImage
  89. mean: [0.485, 0.456, 0.406]
  90. std: [0.229, 0.224, 0.225]
  91. is_scale: True
  92. is_channel_first: false
  93. - !Permute
  94. to_bgr: false
  95. channel_first: True
  96. # Gt2YoloTarget is only used when use_fine_grained_loss set as true,
  97. # this operator will be deleted automatically if use_fine_grained_loss
  98. # is set as false
  99. - !Gt2YoloTarget
  100. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  101. anchors: [[10, 13], [16, 30], [33, 23],
  102. [30, 61], [62, 45], [59, 119],
  103. [116, 90], [156, 198], [373, 326]]
  104. downsample_ratios: [32, 16, 8]
  105. batch_size: 2
  106. shuffle: true
  107. mixup_epoch: 250
  108. drop_last: true
  109. worker_num: 2
  110. bufsize: 2
  111. use_process: false #true
  112. EvalReader:
  113. inputs_def:
  114. fields: ['image', 'im_size', 'im_id', 'gt_bbox', 'gt_class', 'is_difficult']
  115. num_max_boxes: 50
  116. dataset:
  117. !VOCDataSet
  118. dataset_dir: dataset/roadsign_voc
  119. anno_path: valid.txt
  120. with_background: false
  121. sample_transforms:
  122. - !DecodeImage
  123. to_rgb: True
  124. - !ResizeImage
  125. target_size: 608
  126. interp: 2
  127. - !NormalizeImage
  128. mean: [0.485, 0.456, 0.406]
  129. std: [0.229, 0.224, 0.225]
  130. is_scale: True
  131. is_channel_first: false
  132. - !PadBox
  133. num_max_boxes: 50
  134. - !Permute
  135. to_bgr: false
  136. channel_first: True
  137. batch_size: 4
  138. drop_empty: false
  139. worker_num: 4
  140. bufsize: 2
  141. TestReader:
  142. inputs_def:
  143. image_shape: [3, 608, 608]
  144. fields: ['image', 'im_size', 'im_id']
  145. dataset:
  146. !ImageFolder
  147. anno_path: dataset/roadsign_voc/label_list.txt
  148. with_background: false
  149. sample_transforms:
  150. - !DecodeImage
  151. to_rgb: True
  152. - !ResizeImage
  153. target_size: 608
  154. interp: 2
  155. - !NormalizeImage
  156. mean: [0.485, 0.456, 0.406]
  157. std: [0.229, 0.224, 0.225]
  158. is_scale: True
  159. is_channel_first: false
  160. - !Permute
  161. to_bgr: false
  162. channel_first: True
  163. batch_size: 1