ssdlite_mobilenet_v1.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. architecture: SSD
  2. use_gpu: true
  3. max_iters: 400000
  4. snapshot_iter: 20000
  5. log_iter: 20
  6. metric: COCO
  7. pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_ssld_pretrained.tar
  8. save_dir: output
  9. weights: output/ssdlite_mobilenet_v1/model_final
  10. num_classes: 81
  11. SSD:
  12. backbone: MobileNet
  13. multi_box_head: SSDLiteMultiBoxHead
  14. output_decoder:
  15. background_label: 0
  16. keep_top_k: 200
  17. nms_eta: 1.0
  18. nms_threshold: 0.45
  19. nms_top_k: 400
  20. score_threshold: 0.01
  21. MobileNet:
  22. conv_decay: 0.00004
  23. conv_group_scale: 1
  24. extra_block_filters: [[256, 512], [128, 256], [128, 256], [64, 128]]
  25. with_extra_blocks: true
  26. SSDLiteMultiBoxHead:
  27. aspect_ratios: [[2.], [2., 3.], [2., 3.], [2., 3.], [2., 3.], [2., 3.]]
  28. base_size: 300
  29. steps: [16, 32, 64, 100, 150, 300]
  30. flip: true
  31. clip: true
  32. max_ratio: 95
  33. min_ratio: 20
  34. offset: 0.5
  35. conv_decay: 0.00004
  36. LearningRate:
  37. base_lr: 0.4
  38. schedulers:
  39. - !CosineDecay
  40. max_iters: 400000
  41. - !LinearWarmup
  42. start_factor: 0.33333
  43. steps: 2000
  44. OptimizerBuilder:
  45. optimizer:
  46. momentum: 0.9
  47. type: Momentum
  48. regularizer:
  49. factor: 0.0005
  50. type: L2
  51. TrainReader:
  52. inputs_def:
  53. image_shape: [3, 300, 300]
  54. fields: ['image', 'gt_bbox', 'gt_class']
  55. dataset:
  56. !COCODataSet
  57. dataset_dir: dataset/coco
  58. anno_path: annotations/instances_train2017.json
  59. image_dir: train2017
  60. sample_transforms:
  61. - !DecodeImage
  62. to_rgb: true
  63. - !RandomDistort
  64. brightness_lower: 0.875
  65. brightness_upper: 1.125
  66. is_order: true
  67. - !RandomExpand
  68. fill_value: [123.675, 116.28, 103.53]
  69. - !RandomCrop
  70. allow_no_crop: false
  71. - !NormalizeBox {}
  72. - !ResizeImage
  73. interp: 1
  74. target_size: 300
  75. use_cv2: false
  76. - !RandomFlipImage
  77. is_normalized: false
  78. - !NormalizeImage
  79. mean: [0.485, 0.456, 0.406]
  80. std: [0.229, 0.224, 0.225]
  81. is_scale: true
  82. is_channel_first: false
  83. - !Permute
  84. to_bgr: false
  85. channel_first: true
  86. batch_size: 64
  87. shuffle: true
  88. drop_last: true
  89. # Number of working threads/processes. To speed up, can be set to 16 or 32 etc.
  90. worker_num: 8
  91. # Size of shared memory used in result queue. After increasing `worker_num`, need expand `memsize`.
  92. memsize: 8G
  93. # Buffer size for multi threads/processes.one instance in buffer is one batch data.
  94. # To speed up, can be set to 64 or 128 etc.
  95. bufsize: 32
  96. use_process: true
  97. EvalReader:
  98. inputs_def:
  99. image_shape: [3, 300, 300]
  100. fields: ['image', 'gt_bbox', 'gt_class', 'im_shape', 'im_id']
  101. dataset:
  102. !COCODataSet
  103. dataset_dir: dataset/coco
  104. anno_path: annotations/instances_val2017.json
  105. image_dir: val2017
  106. sample_transforms:
  107. - !DecodeImage
  108. to_rgb: true
  109. - !NormalizeBox {}
  110. - !ResizeImage
  111. interp: 1
  112. target_size: 300
  113. use_cv2: false
  114. - !NormalizeImage
  115. mean: [0.485, 0.456, 0.406]
  116. std: [0.229, 0.224, 0.225]
  117. is_scale: true
  118. is_channel_first: false
  119. - !Permute
  120. to_bgr: false
  121. channel_first: True
  122. batch_size: 8
  123. worker_num: 8
  124. bufsize: 32
  125. use_process: false
  126. TestReader:
  127. inputs_def:
  128. image_shape: [3,300,300]
  129. fields: ['image', 'im_id', 'im_shape']
  130. dataset:
  131. !ImageFolder
  132. anno_path: annotations/instances_val2017.json
  133. sample_transforms:
  134. - !DecodeImage
  135. to_rgb: true
  136. - !ResizeImage
  137. interp: 1
  138. max_size: 0
  139. target_size: 300
  140. use_cv2: true
  141. - !NormalizeImage
  142. mean: [0.485, 0.456, 0.406]
  143. std: [0.229, 0.224, 0.225]
  144. is_scale: true
  145. is_channel_first: false
  146. - !Permute
  147. to_bgr: false
  148. channel_first: True
  149. batch_size: 1