solov2_light_reader.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. TrainReader:
  2. batch_size: 2
  3. worker_num: 2
  4. inputs_def:
  5. fields: ['image', 'im_id', 'gt_segm']
  6. dataset:
  7. !COCODataSet
  8. dataset_dir: dataset/coco
  9. anno_path: annotations/instances_train2017.json
  10. image_dir: train2017
  11. sample_transforms:
  12. - !DecodeImage
  13. to_rgb: true
  14. - !Poly2Mask {}
  15. - !ColorDistort {}
  16. - !RandomCrop
  17. is_mask_crop: True
  18. - !ResizeImage
  19. target_size: [352, 384, 416, 448, 480, 512]
  20. max_size: 852
  21. interp: 1
  22. use_cv2: true
  23. resize_box: true
  24. - !RandomFlipImage
  25. prob: 0.5
  26. - !NormalizeImage
  27. is_channel_first: false
  28. is_scale: true
  29. mean: [0.485,0.456,0.406]
  30. std: [0.229, 0.224,0.225]
  31. - !Permute
  32. to_bgr: false
  33. channel_first: true
  34. batch_transforms:
  35. - !PadBatch
  36. pad_to_stride: 32
  37. - !Gt2Solov2Target
  38. num_grids: [40, 36, 24, 16, 12]
  39. scale_ranges: [[1, 64], [32, 128], [64, 256], [128, 512], [256, 2048]]
  40. coord_sigma: 0.2
  41. shuffle: True
  42. EvalReader:
  43. inputs_def:
  44. fields: ['image', 'im_info', 'im_id']
  45. dataset:
  46. !COCODataSet
  47. image_dir: val2017
  48. anno_path: annotations/instances_val2017.json
  49. dataset_dir: dataset/coco
  50. sample_transforms:
  51. - !DecodeImage
  52. to_rgb: true
  53. - !ResizeImage
  54. interp: 1
  55. max_size: 852
  56. target_size: 512
  57. use_cv2: true
  58. - !NormalizeImage
  59. is_channel_first: false
  60. is_scale: true
  61. mean: [0.485,0.456,0.406]
  62. std: [0.229, 0.224,0.225]
  63. - !Permute
  64. channel_first: true
  65. to_bgr: false
  66. batch_transforms:
  67. - !PadBatch
  68. pad_to_stride: 32
  69. use_padded_im_info: false
  70. # only support batch_size=1 when evaluation
  71. batch_size: 1
  72. shuffle: false
  73. drop_last: false
  74. drop_empty: false
  75. worker_num: 2
  76. TestReader:
  77. inputs_def:
  78. fields: ['image', 'im_info', 'im_id', 'im_shape']
  79. dataset:
  80. !ImageFolder
  81. anno_path: dataset/coco/annotations/instances_val2017.json
  82. sample_transforms:
  83. - !DecodeImage
  84. to_rgb: true
  85. - !ResizeImage
  86. interp: 1
  87. max_size: 852
  88. target_size: 512
  89. use_cv2: true
  90. - !NormalizeImage
  91. is_channel_first: false
  92. is_scale: true
  93. mean: [0.485,0.456,0.406]
  94. std: [0.229, 0.224,0.225]
  95. - !Permute
  96. channel_first: true
  97. to_bgr: false
  98. batch_transforms:
  99. - !PadBatch
  100. pad_to_stride: 32
  101. use_padded_im_info: false