yolov3_reader.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. TrainReader:
  2. inputs_def:
  3. fields: ['image', 'gt_bbox', 'gt_class', 'gt_score']
  4. num_max_boxes: 50
  5. dataset:
  6. !COCODataSet
  7. image_dir: train2017
  8. anno_path: annotations/instances_train2017.json
  9. dataset_dir: dataset/coco
  10. with_background: false
  11. sample_transforms:
  12. - !DecodeImage
  13. to_rgb: True
  14. with_mixup: True
  15. - !MixupImage
  16. alpha: 1.5
  17. beta: 1.5
  18. - !ColorDistort {}
  19. - !RandomExpand
  20. fill_value: [123.675, 116.28, 103.53]
  21. - !RandomCrop {}
  22. - !RandomFlipImage
  23. is_normalized: false
  24. - !NormalizeBox {}
  25. - !PadBox
  26. num_max_boxes: 50
  27. - !BboxXYXY2XYWH {}
  28. batch_transforms:
  29. - !RandomShape
  30. sizes: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608]
  31. random_inter: True
  32. - !NormalizeImage
  33. mean: [0.485, 0.456, 0.406]
  34. std: [0.229, 0.224, 0.225]
  35. is_scale: True
  36. is_channel_first: false
  37. - !Permute
  38. to_bgr: false
  39. channel_first: True
  40. # Gt2YoloTarget is only used when use_fine_grained_loss set as true,
  41. # this operator will be deleted automatically if use_fine_grained_loss
  42. # is set as false
  43. - !Gt2YoloTarget
  44. anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
  45. anchors: [[10, 13], [16, 30], [33, 23],
  46. [30, 61], [62, 45], [59, 119],
  47. [116, 90], [156, 198], [373, 326]]
  48. downsample_ratios: [32, 16, 8]
  49. batch_size: 8
  50. shuffle: true
  51. mixup_epoch: 250
  52. drop_last: true
  53. worker_num: 8
  54. bufsize: 16
  55. use_process: true
  56. EvalReader:
  57. inputs_def:
  58. fields: ['image', 'im_size', 'im_id']
  59. num_max_boxes: 50
  60. dataset:
  61. !COCODataSet
  62. image_dir: val2017
  63. anno_path: annotations/instances_val2017.json
  64. dataset_dir: dataset/coco
  65. with_background: false
  66. sample_transforms:
  67. - !DecodeImage
  68. to_rgb: True
  69. - !ResizeImage
  70. target_size: 608
  71. interp: 2
  72. - !NormalizeImage
  73. mean: [0.485, 0.456, 0.406]
  74. std: [0.229, 0.224, 0.225]
  75. is_scale: True
  76. is_channel_first: false
  77. - !PadBox
  78. num_max_boxes: 50
  79. - !Permute
  80. to_bgr: false
  81. channel_first: True
  82. batch_size: 8
  83. drop_empty: false
  84. worker_num: 8
  85. bufsize: 16
  86. TestReader:
  87. inputs_def:
  88. image_shape: [3, 608, 608]
  89. fields: ['image', 'im_size', 'im_id']
  90. dataset:
  91. !ImageFolder
  92. anno_path: annotations/instances_val2017.json
  93. with_background: false
  94. sample_transforms:
  95. - !DecodeImage
  96. to_rgb: True
  97. - !ResizeImage
  98. target_size: 608
  99. interp: 2
  100. - !NormalizeImage
  101. mean: [0.485, 0.456, 0.406]
  102. std: [0.229, 0.224, 0.225]
  103. is_scale: True
  104. is_channel_first: false
  105. - !Permute
  106. to_bgr: false
  107. channel_first: True
  108. batch_size: 1