You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

coco_instance_semantic.py 1.9 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # dataset settings
  2. dataset_type = 'CocoDataset'
  3. data_root = 'data/coco/'
  4. img_norm_cfg = dict(
  5. mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  6. train_pipeline = [
  7. dict(type='LoadImageFromFile'),
  8. dict(
  9. type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True),
  10. dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
  11. dict(type='RandomFlip', flip_ratio=0.5),
  12. dict(type='Normalize', **img_norm_cfg),
  13. dict(type='Pad', size_divisor=32),
  14. dict(type='SegRescale', scale_factor=1 / 8),
  15. dict(type='DefaultFormatBundle'),
  16. dict(
  17. type='Collect',
  18. keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg']),
  19. ]
  20. test_pipeline = [
  21. dict(type='LoadImageFromFile'),
  22. dict(
  23. type='MultiScaleFlipAug',
  24. img_scale=(1333, 800),
  25. flip=False,
  26. transforms=[
  27. dict(type='Resize', keep_ratio=True),
  28. dict(type='RandomFlip', flip_ratio=0.5),
  29. dict(type='Normalize', **img_norm_cfg),
  30. dict(type='Pad', size_divisor=32),
  31. dict(type='ImageToTensor', keys=['img']),
  32. dict(type='Collect', keys=['img']),
  33. ])
  34. ]
  35. data = dict(
  36. samples_per_gpu=2,
  37. workers_per_gpu=2,
  38. train=dict(
  39. type=dataset_type,
  40. ann_file=data_root + 'annotations/instances_train2017.json',
  41. img_prefix=data_root + 'train2017/',
  42. seg_prefix=data_root + 'stuffthingmaps/train2017/',
  43. pipeline=train_pipeline),
  44. val=dict(
  45. type=dataset_type,
  46. ann_file=data_root + 'annotations/instances_val2017.json',
  47. img_prefix=data_root + 'val2017/',
  48. pipeline=test_pipeline),
  49. test=dict(
  50. type=dataset_type,
  51. ann_file=data_root + 'annotations/instances_val2017.json',
  52. img_prefix=data_root + 'val2017/',
  53. pipeline=test_pipeline))
  54. evaluation = dict(metric=['bbox', 'segm'])

No Description

Contributors (1)