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.

cityscapes_instance.py 2.0 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # dataset settings
  2. dataset_type = 'CityscapesDataset'
  3. data_root = 'data/cityscapes/'
  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(type='LoadAnnotations', with_bbox=True, with_mask=True),
  9. dict(
  10. type='Resize', img_scale=[(2048, 800), (2048, 1024)], 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='DefaultFormatBundle'),
  15. dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
  16. ]
  17. test_pipeline = [
  18. dict(type='LoadImageFromFile'),
  19. dict(
  20. type='MultiScaleFlipAug',
  21. img_scale=(2048, 1024),
  22. flip=False,
  23. transforms=[
  24. dict(type='Resize', keep_ratio=True),
  25. dict(type='RandomFlip'),
  26. dict(type='Normalize', **img_norm_cfg),
  27. dict(type='Pad', size_divisor=32),
  28. dict(type='ImageToTensor', keys=['img']),
  29. dict(type='Collect', keys=['img']),
  30. ])
  31. ]
  32. data = dict(
  33. samples_per_gpu=1,
  34. workers_per_gpu=2,
  35. train=dict(
  36. type='RepeatDataset',
  37. times=8,
  38. dataset=dict(
  39. type=dataset_type,
  40. ann_file=data_root +
  41. 'annotations/instancesonly_filtered_gtFine_train.json',
  42. img_prefix=data_root + 'leftImg8bit/train/',
  43. pipeline=train_pipeline)),
  44. val=dict(
  45. type=dataset_type,
  46. ann_file=data_root +
  47. 'annotations/instancesonly_filtered_gtFine_val.json',
  48. img_prefix=data_root + 'leftImg8bit/val/',
  49. pipeline=test_pipeline),
  50. test=dict(
  51. type=dataset_type,
  52. ann_file=data_root +
  53. 'annotations/instancesonly_filtered_gtFine_test.json',
  54. img_prefix=data_root + 'leftImg8bit/test/',
  55. pipeline=test_pipeline))
  56. evaluation = dict(metric=['bbox', 'segm'])

No Description

Contributors (2)