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_panoptic.py 2.1 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # dataset settings
  2. dataset_type = 'CocoPanopticDataset'
  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='LoadPanopticAnnotations',
  10. with_bbox=True,
  11. with_mask=True,
  12. with_seg=True),
  13. dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
  14. dict(type='RandomFlip', flip_ratio=0.5),
  15. dict(type='Normalize', **img_norm_cfg),
  16. dict(type='Pad', size_divisor=32),
  17. dict(type='SegRescale', scale_factor=1 / 4),
  18. dict(type='DefaultFormatBundle'),
  19. dict(
  20. type='Collect',
  21. keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg']),
  22. ]
  23. test_pipeline = [
  24. dict(type='LoadImageFromFile'),
  25. dict(
  26. type='MultiScaleFlipAug',
  27. img_scale=(1333, 800),
  28. flip=False,
  29. transforms=[
  30. dict(type='Resize', keep_ratio=True),
  31. dict(type='RandomFlip'),
  32. dict(type='Normalize', **img_norm_cfg),
  33. dict(type='Pad', size_divisor=32),
  34. dict(type='ImageToTensor', keys=['img']),
  35. dict(type='Collect', keys=['img']),
  36. ])
  37. ]
  38. data = dict(
  39. samples_per_gpu=2,
  40. workers_per_gpu=2,
  41. train=dict(
  42. type=dataset_type,
  43. ann_file=data_root + 'annotations/panoptic_train2017.json',
  44. img_prefix=data_root + 'train2017/',
  45. seg_prefix=data_root + 'annotations/panoptic_train2017/',
  46. pipeline=train_pipeline),
  47. val=dict(
  48. type=dataset_type,
  49. ann_file=data_root + 'annotations/panoptic_val2017.json',
  50. img_prefix=data_root + 'val2017/',
  51. seg_prefix=data_root + 'annotations/panoptic_val2017/',
  52. pipeline=test_pipeline),
  53. test=dict(
  54. type=dataset_type,
  55. ann_file=data_root + 'annotations/panoptic_val2017.json',
  56. img_prefix=data_root + 'val2017/',
  57. seg_prefix=data_root + 'annotations/panoptic_val2017/',
  58. pipeline=test_pipeline))
  59. evaluation = dict(interval=1, metric=['PQ'])

No Description

Contributors (2)