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