|
| 1 | +# dataset settings |
| 2 | +dataset_type = 'ADE20KDataset' |
| 3 | +data_root = 'data/ade/ADEChallengeData2016' |
| 4 | +img_norm_cfg = dict( |
| 5 | + mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) |
| 6 | +crop_size = (512, 512) |
| 7 | +train_pipeline = [ |
| 8 | + dict(type='LoadImageFromFile'), |
| 9 | + dict(type='LoadAnnotations', reduce_zero_label=True), |
| 10 | + dict(type='Resize', img_scale=(2048, 512), ratio_range=(0.5, 2.0)), |
| 11 | + dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), |
| 12 | + dict(type='RandomFlip', prob=0.5), |
| 13 | + dict(type='PhotoMetricDistortion'), |
| 14 | + dict(type='Normalize', **img_norm_cfg), |
| 15 | + dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), |
| 16 | + dict(type='DefaultFormatBundle'), |
| 17 | + dict(type='Collect', keys=['img', 'gt_semantic_seg']), |
| 18 | +] |
| 19 | +test_pipeline = [ |
| 20 | + dict(type='LoadImageFromFile'), |
| 21 | + dict( |
| 22 | + type='MultiScaleFlipAug', |
| 23 | + img_scale=(2048, 512), |
| 24 | + # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], |
| 25 | + flip=False, |
| 26 | + transforms=[ |
| 27 | + dict(type='Resize', keep_ratio=True), |
| 28 | + dict(type='RandomFlip'), |
| 29 | + dict(type='Normalize', **img_norm_cfg), |
| 30 | + dict(type='ImageToTensor', keys=['img']), |
| 31 | + dict(type='Collect', keys=['img']), |
| 32 | + ]) |
| 33 | +] |
| 34 | +data = dict( |
| 35 | + samples_per_gpu=4, |
| 36 | + workers_per_gpu=4, |
| 37 | + train=dict( |
| 38 | + type=dataset_type, |
| 39 | + data_root=data_root, |
| 40 | + img_dir='images/training', |
| 41 | + ann_dir='annotations/training', |
| 42 | + pipeline=train_pipeline), |
| 43 | + val=dict( |
| 44 | + type=dataset_type, |
| 45 | + data_root=data_root, |
| 46 | + img_dir='images/validation', |
| 47 | + ann_dir='annotations/validation', |
| 48 | + pipeline=test_pipeline), |
| 49 | + test=dict( |
| 50 | + type=dataset_type, |
| 51 | + data_root=data_root, |
| 52 | + img_dir='images/validation', |
| 53 | + ann_dir='annotations/validation', |
| 54 | + pipeline=test_pipeline)) |
0 commit comments