solov2_reader.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. - !ResizeImage
  16. target_size: 800
  17. max_size: 1333
  18. interp: 1
  19. use_cv2: true
  20. resize_box: true
  21. - !RandomFlipImage
  22. prob: 0.5
  23. - !NormalizeImage
  24. is_channel_first: false
  25. is_scale: true
  26. mean: [0.485,0.456,0.406]
  27. std: [0.229, 0.224,0.225]
  28. - !Permute
  29. to_bgr: false
  30. channel_first: true
  31. batch_transforms:
  32. - !PadBatch
  33. pad_to_stride: 32
  34. - !Gt2Solov2Target
  35. num_grids: [40, 36, 24, 16, 12]
  36. scale_ranges: [[1, 96], [48, 192], [96, 384], [192, 768], [384, 2048]]
  37. coord_sigma: 0.2
  38. shuffle: True
  39. EvalReader:
  40. inputs_def:
  41. fields: ['image', 'im_info', 'im_id']
  42. dataset:
  43. !COCODataSet
  44. image_dir: val2017
  45. anno_path: annotations/instances_val2017.json
  46. dataset_dir: dataset/coco
  47. sample_transforms:
  48. - !DecodeImage
  49. to_rgb: true
  50. - !ResizeImage
  51. interp: 1
  52. max_size: 1333
  53. target_size: 800
  54. use_cv2: true
  55. - !NormalizeImage
  56. is_channel_first: false
  57. is_scale: true
  58. mean: [0.485,0.456,0.406]
  59. std: [0.229, 0.224,0.225]
  60. - !Permute
  61. channel_first: true
  62. to_bgr: false
  63. batch_transforms:
  64. - !PadBatch
  65. pad_to_stride: 32
  66. use_padded_im_info: false
  67. # only support batch_size=1 when evaluation
  68. batch_size: 1
  69. shuffle: false
  70. drop_last: false
  71. drop_empty: false
  72. worker_num: 2
  73. TestReader:
  74. inputs_def:
  75. fields: ['image', 'im_info', 'im_id', 'im_shape']
  76. dataset:
  77. !ImageFolder
  78. anno_path: dataset/coco/annotations/instances_val2017.json
  79. sample_transforms:
  80. - !DecodeImage
  81. to_rgb: true
  82. - !ResizeImage
  83. interp: 1
  84. max_size: 1333
  85. target_size: 800
  86. use_cv2: true
  87. - !NormalizeImage
  88. is_channel_first: false
  89. is_scale: true
  90. mean: [0.485,0.456,0.406]
  91. std: [0.229, 0.224,0.225]
  92. - !Permute
  93. channel_first: true
  94. to_bgr: false
  95. batch_transforms:
  96. - !PadBatch
  97. pad_to_stride: 32
  98. use_padded_im_info: false