ppyolo_tiny.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. architecture: YOLOv3
  2. use_gpu: true
  3. max_iters: 300000
  4. log_smooth_window: 100
  5. log_iter: 100
  6. save_dir: output
  7. snapshot_iter: 10000
  8. metric: COCO
  9. pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV3_large_x0_5_pretrained.tar
  10. weights: output/ppyolo_tiny/model_final
  11. num_classes: 80
  12. use_fine_grained_loss: true
  13. use_ema: true
  14. ema_decay: 0.9998
  15. YOLOv3:
  16. backbone: MobileNetV3
  17. yolo_head: PPYOLOTinyHead
  18. use_fine_grained_loss: true
  19. MobileNetV3:
  20. norm_type: sync_bn
  21. norm_decay: 0.
  22. model_name: large
  23. scale: .5
  24. extra_block_filters: []
  25. feature_maps: [1, 2, 3, 4, 6]
  26. PPYOLOTinyHead:
  27. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  28. anchors: [[10, 15], [24, 36], [72, 42],
  29. [35, 87], [102, 96], [60, 170],
  30. [220, 125], [128, 222], [264, 266]]
  31. detection_block_channels: [160, 128, 96]
  32. norm_decay: 0.
  33. scale_x_y: 1.05
  34. yolo_loss: YOLOv3Loss
  35. spp: true
  36. drop_block: true
  37. nms:
  38. background_label: -1
  39. keep_top_k: 100
  40. nms_threshold: 0.45
  41. nms_top_k: 1000
  42. normalized: false
  43. score_threshold: 0.01
  44. YOLOv3Loss:
  45. ignore_thresh: 0.5
  46. scale_x_y: 1.05
  47. label_smooth: false
  48. use_fine_grained_loss: true
  49. iou_loss: IouLoss
  50. IouLoss:
  51. loss_weight: 2.5
  52. max_height: 512
  53. max_width: 512
  54. LearningRate:
  55. base_lr: 0.005
  56. schedulers:
  57. - !PiecewiseDecay
  58. gamma: 0.1
  59. milestones:
  60. - 200000
  61. - 250000
  62. - 280000
  63. - !LinearWarmup
  64. start_factor: 0.
  65. steps: 4000
  66. OptimizerBuilder:
  67. optimizer:
  68. momentum: 0.949
  69. type: Momentum
  70. regularizer:
  71. factor: 0.0005
  72. type: L2
  73. TrainReader:
  74. inputs_def:
  75. fields: ['image', 'gt_bbox', 'gt_class', 'gt_score']
  76. num_max_boxes: 100
  77. dataset:
  78. !COCODataSet
  79. image_dir: train2017
  80. anno_path: annotations/instances_train2017.json
  81. dataset_dir: train_data/dataset/coco
  82. with_background: false
  83. sample_transforms:
  84. - !DecodeImage
  85. to_rgb: True
  86. with_mixup: True
  87. - !MixupImage
  88. alpha: 1.5
  89. beta: 1.5
  90. - !ColorDistort {}
  91. - !RandomExpand
  92. fill_value: [123.675, 116.28, 103.53]
  93. ratio: 2
  94. - !RandomCrop {}
  95. - !RandomFlipImage
  96. is_normalized: false
  97. - !NormalizeBox {}
  98. - !PadBox
  99. num_max_boxes: 100
  100. - !BboxXYXY2XYWH {}
  101. batch_transforms:
  102. - !RandomShape
  103. sizes: [192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512]
  104. random_inter: True
  105. - !NormalizeImage
  106. mean: [0.485, 0.456, 0.406]
  107. std: [0.229, 0.224, 0.225]
  108. is_scale: True
  109. is_channel_first: false
  110. - !Permute
  111. to_bgr: false
  112. channel_first: True
  113. # Gt2YoloTarget is only used when use_fine_grained_loss set as true,
  114. # this operator will be deleted automatically if use_fine_grained_loss
  115. # is set as false
  116. - !Gt2YoloTarget
  117. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  118. anchors: [[10, 15], [24, 36], [72, 42],
  119. [35, 87], [102, 96], [60, 170],
  120. [220, 125], [128, 222], [264, 266]]
  121. downsample_ratios: [32, 16, 8]
  122. iou_thresh: 0.25
  123. num_classes: 80
  124. batch_size: 32
  125. shuffle: true
  126. mixup_epoch: 200
  127. drop_last: true
  128. worker_num: 16
  129. bufsize: 4
  130. use_process: true
  131. EvalReader:
  132. inputs_def:
  133. fields: ['image', 'im_size', 'im_id']
  134. num_max_boxes: 100
  135. dataset:
  136. !COCODataSet
  137. image_dir: val2017
  138. anno_path: annotations/instances_val2017.json
  139. dataset_dir: train_data/dataset/coco
  140. with_background: false
  141. sample_transforms:
  142. - !DecodeImage
  143. to_rgb: True
  144. - !ResizeImage
  145. target_size: 320
  146. interp: 2
  147. - !NormalizeImage
  148. mean: [0.485, 0.456, 0.406]
  149. std: [0.229, 0.224, 0.225]
  150. is_scale: True
  151. is_channel_first: false
  152. - !PadBox
  153. num_max_boxes: 100
  154. - !Permute
  155. to_bgr: false
  156. channel_first: True
  157. batch_size: 1
  158. drop_empty: false
  159. worker_num: 2
  160. bufsize: 4
  161. TestReader:
  162. inputs_def:
  163. image_shape: [3, 320, 320]
  164. fields: ['image', 'im_size', 'im_id']
  165. dataset:
  166. !ImageFolder
  167. anno_path: annotations/instances_val2017.json
  168. with_background: false
  169. sample_transforms:
  170. - !DecodeImage
  171. to_rgb: True
  172. - !ResizeImage
  173. target_size: 320
  174. interp: 2
  175. - !NormalizeImage
  176. mean: [0.485, 0.456, 0.406]
  177. std: [0.229, 0.224, 0.225]
  178. is_scale: True
  179. is_channel_first: false
  180. - !Permute
  181. to_bgr: false
  182. channel_first: True
  183. batch_size: 1