yolov4_cspdarknet_coco.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. architecture: YOLOv4
  2. use_gpu: true
  3. max_iters: 500200
  4. log_iter: 20
  5. save_dir: output
  6. snapshot_iter: 10000
  7. metric: COCO
  8. pretrain_weights: https://paddlemodels.bj.bcebos.com/object_detection/CSPDarkNet53_pretrained.pdparams
  9. weights: output/yolov4_cspdarknet_coco/model_final
  10. num_classes: 80
  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. - 400000
  52. - 450000
  53. - !LinearWarmup
  54. start_factor: 0.
  55. steps: 4000
  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. !COCODataSet
  71. image_dir: train2017
  72. anno_path: annotations/instances_train2017.json
  73. dataset_dir: dataset/coco
  74. with_background: false
  75. sample_transforms:
  76. - !DecodeImage
  77. to_rgb: True
  78. - !ColorDistort {}
  79. - !RandomExpand
  80. fill_value: [123.675, 116.28, 103.53]
  81. - !RandomCrop {}
  82. - !RandomFlipImage
  83. is_normalized: false
  84. - !NormalizeBox {}
  85. - !PadBox
  86. num_max_boxes: 50
  87. - !BboxXYXY2XYWH {}
  88. batch_transforms:
  89. - !RandomShape
  90. sizes: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608]
  91. random_inter: True
  92. - !NormalizeImage
  93. mean: [0.,0.,0.]
  94. std: [1.,1.,1.]
  95. is_scale: True
  96. is_channel_first: false
  97. - !Permute
  98. to_bgr: false
  99. channel_first: True
  100. # Gt2YoloTarget is only used when use_fine_grained_loss set as true,
  101. # this operator will be deleted automatically if use_fine_grained_loss
  102. # is set as false
  103. - !Gt2YoloTarget
  104. anchor_masks: [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
  105. anchors: [[12, 16], [19, 36], [40, 28],
  106. [36, 75], [76, 55], [72, 146],
  107. [142, 110], [192, 243], [459, 401]]
  108. downsample_ratios: [8, 16, 32]
  109. batch_size: 8
  110. shuffle: true
  111. drop_last: true
  112. worker_num: 8
  113. bufsize: 16
  114. use_process: true
  115. drop_empty: false
  116. EvalReader:
  117. inputs_def:
  118. fields: ['image', 'im_size', 'im_id']
  119. num_max_boxes: 90
  120. dataset:
  121. !COCODataSet
  122. image_dir: val2017
  123. anno_path: annotations/instances_val2017.json
  124. dataset_dir: dataset/coco
  125. with_background: false
  126. sample_transforms:
  127. - !DecodeImage
  128. to_rgb: True
  129. - !ResizeImage
  130. target_size: 608
  131. interp: 1
  132. - !NormalizeImage
  133. mean: [0., 0., 0.]
  134. std: [1., 1., 1.]
  135. is_scale: True
  136. is_channel_first: false
  137. - !PadBox
  138. num_max_boxes: 90
  139. - !Permute
  140. to_bgr: false
  141. channel_first: True
  142. batch_size: 4
  143. drop_empty: false
  144. worker_num: 8
  145. bufsize: 16
  146. TestReader:
  147. dataset:
  148. !ImageFolder
  149. use_default_label: true
  150. with_background: false
  151. sample_transforms:
  152. - !DecodeImage
  153. to_rgb: True
  154. - !ResizeImage
  155. target_size: 608
  156. interp: 1
  157. - !NormalizeImage
  158. mean: [0., 0., 0.]
  159. std: [1., 1., 1.]
  160. is_scale: True
  161. is_channel_first: false
  162. - !Permute
  163. to_bgr: false
  164. channel_first: True