yolov3_mobilenet_v1_fruit.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. architecture: YOLOv3
  2. use_gpu: true
  3. max_iters: 20000
  4. log_iter: 20
  5. save_dir: output
  6. snapshot_iter: 200
  7. metric: VOC
  8. map_type: 11point
  9. pretrain_weights: https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
  10. weights: output/yolov3_mobilenet_v1_fruit/best_model
  11. num_classes: 3
  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_type: sync_bn
  19. norm_decay: 0.
  20. conv_group_scale: 1
  21. with_extra_blocks: false
  22. YOLOv3Head:
  23. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  24. anchors: [[10, 13], [16, 30], [33, 23],
  25. [30, 61], [62, 45], [59, 119],
  26. [116, 90], [156, 198], [373, 326]]
  27. norm_decay: 0.
  28. yolo_loss: YOLOv3Loss
  29. nms:
  30. background_label: -1
  31. keep_top_k: 100
  32. nms_threshold: 0.45
  33. nms_top_k: 1000
  34. normalized: false
  35. score_threshold: 0.01
  36. YOLOv3Loss:
  37. ignore_thresh: 0.7
  38. label_smooth: true
  39. LearningRate:
  40. base_lr: 0.00001
  41. schedulers:
  42. - !PiecewiseDecay
  43. gamma: 0.1
  44. milestones:
  45. - 15000
  46. - 18000
  47. - !LinearWarmup
  48. start_factor: 0.
  49. steps: 100
  50. OptimizerBuilder:
  51. optimizer:
  52. momentum: 0.9
  53. type: Momentum
  54. regularizer:
  55. factor: 0.0005
  56. type: L2
  57. _READER_: 'yolov3_reader.yml'
  58. # will merge TrainReader into yolov3_reader.yml
  59. TrainReader:
  60. inputs_def:
  61. image_shape: [3, 608, 608]
  62. fields: ['image', 'gt_bbox', 'gt_class', 'gt_score']
  63. num_max_boxes: 50
  64. dataset:
  65. !VOCDataSet
  66. dataset_dir: dataset/fruit
  67. anno_path: train.txt
  68. with_background: false
  69. use_default_label: false
  70. sample_transforms:
  71. - !DecodeImage
  72. to_rgb: true
  73. with_mixup: false
  74. - !NormalizeBox {}
  75. - !ExpandImage
  76. max_ratio: 4.0
  77. mean: [123.675, 116.28, 103.53]
  78. prob: 0.5
  79. - !RandomInterpImage
  80. max_size: 0
  81. target_size: 608
  82. - !RandomFlipImage
  83. is_normalized: true
  84. prob: 0.5
  85. - !NormalizeImage
  86. mean: [0.485, 0.456, 0.406]
  87. std: [0.229, 0.224, 0.225]
  88. is_scale: true
  89. is_channel_first: false
  90. - !PadBox
  91. num_max_boxes: 50
  92. - !BboxXYXY2XYWH {}
  93. batch_transforms:
  94. - !RandomShape
  95. sizes: [608]
  96. - !Permute
  97. channel_first: true
  98. to_bgr: false
  99. batch_size: 1
  100. shuffle: true
  101. mixup_epoch: -1
  102. EvalReader:
  103. batch_size: 1
  104. inputs_def:
  105. image_shape: [3, 608, 608]
  106. fields: ['image', 'im_size', 'im_id', 'gt_bbox', 'gt_class', 'is_difficult']
  107. num_max_boxes: 50
  108. dataset:
  109. !VOCDataSet
  110. dataset_dir: dataset/fruit
  111. anno_path: val.txt
  112. use_default_label: false
  113. with_background: false
  114. TestReader:
  115. batch_size: 1
  116. dataset:
  117. !ImageFolder
  118. anno_path: dataset/fruit/label_list.txt
  119. use_default_label: false
  120. with_background: false