yolov3_mobilenet_v1_roadsign.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. architecture: YOLOv3
  2. use_gpu: true
  3. max_iters: 3600
  4. log_smooth_window: 20
  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_mobilenet_v1.tar
  10. weights: output/yolov3_mobilenet_v1_roadsign/best_model
  11. num_classes: 4
  12. finetune_exclude_pretrained_params: ['yolo_output']
  13. use_fine_grained_loss: false
  14. YOLOv3:
  15. backbone: MobileNet
  16. yolo_head: YOLOv3Head
  17. MobileNet:
  18. norm_decay: 0.
  19. conv_group_scale: 1
  20. with_extra_blocks: false
  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. yolo_loss: YOLOv3Loss
  27. nms:
  28. background_label: -1
  29. keep_top_k: 100
  30. nms_threshold: 0.45
  31. nms_top_k: 1000
  32. normalized: false
  33. score_threshold: 0.01
  34. YOLOv3Loss:
  35. ignore_thresh: 0.7
  36. label_smooth: true
  37. LearningRate:
  38. base_lr: 0.0001
  39. schedulers:
  40. - !PiecewiseDecay
  41. gamma: 0.1
  42. milestones:
  43. - 2400
  44. - 3300
  45. - !LinearWarmup
  46. start_factor: 0.3333333333333333
  47. steps: 100
  48. OptimizerBuilder:
  49. optimizer:
  50. momentum: 0.9
  51. type: Momentum
  52. regularizer:
  53. factor: 0.0005
  54. type: L2
  55. # _READER_: 'yolov3_reader.yml'
  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. use_default_label: 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: 8
  106. shuffle: true
  107. mixup_epoch: 250
  108. drop_last: true
  109. worker_num: 4
  110. bufsize: 2
  111. use_process: 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. use_default_label: false
  122. sample_transforms:
  123. - !DecodeImage
  124. to_rgb: True
  125. - !ResizeImage
  126. target_size: 608
  127. interp: 2
  128. - !NormalizeImage
  129. mean: [0.485, 0.456, 0.406]
  130. std: [0.229, 0.224, 0.225]
  131. is_scale: True
  132. is_channel_first: false
  133. - !PadBox
  134. num_max_boxes: 50
  135. - !Permute
  136. to_bgr: false
  137. channel_first: True
  138. batch_size: 1
  139. drop_empty: false
  140. worker_num: 4
  141. bufsize: 2
  142. TestReader:
  143. inputs_def:
  144. image_shape: [3, 608, 608]
  145. fields: ['image', 'im_size', 'im_id']
  146. dataset:
  147. !ImageFolder
  148. anno_path: dataset/roadsign_voc/label_list.txt
  149. with_background: false
  150. use_default_label: false
  151. sample_transforms:
  152. - !DecodeImage
  153. to_rgb: True
  154. - !ResizeImage
  155. target_size: 608
  156. interp: 2
  157. - !NormalizeImage
  158. mean: [0.485, 0.456, 0.406]
  159. std: [0.229, 0.224, 0.225]
  160. is_scale: True
  161. is_channel_first: false
  162. - !Permute
  163. to_bgr: false
  164. channel_first: True
  165. batch_size: 1