yolov4_cspdarknet_voc.yml 3.7 KB

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