yolov3_darknet_roadsign.yml 3.8 KB

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