|
| 1 | +# dataset settings |
| 2 | +dataset_type = 'iSAIDDataset' |
| 3 | +data_root = 'data/iSAID' |
| 4 | + |
| 5 | +img_norm_cfg = dict( |
| 6 | + mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) |
| 7 | +""" |
| 8 | +This crop_size setting is followed by the implementation of |
| 9 | +`PointFlow: Flowing Semantics Through Points for Aerial Image |
| 10 | +Segmentation <https://arxiv.org/pdf/2103.06564.pdf>`_. |
| 11 | +""" |
| 12 | + |
| 13 | +crop_size = (896, 896) |
| 14 | + |
| 15 | +train_pipeline = [ |
| 16 | + dict(type='LoadImageFromFile'), |
| 17 | + dict(type='LoadAnnotations'), |
| 18 | + dict(type='Resize', img_scale=(896, 896), ratio_range=(0.5, 2.0)), |
| 19 | + dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), |
| 20 | + dict(type='RandomFlip', prob=0.5), |
| 21 | + dict(type='PhotoMetricDistortion'), |
| 22 | + dict(type='Normalize', **img_norm_cfg), |
| 23 | + dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), |
| 24 | + dict(type='DefaultFormatBundle'), |
| 25 | + dict(type='Collect', keys=['img', 'gt_semantic_seg']), |
| 26 | +] |
| 27 | +test_pipeline = [ |
| 28 | + dict(type='LoadImageFromFile'), |
| 29 | + dict( |
| 30 | + type='MultiScaleFlipAug', |
| 31 | + img_scale=(896, 896), |
| 32 | + # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], |
| 33 | + flip=False, |
| 34 | + transforms=[ |
| 35 | + dict(type='Resize', keep_ratio=True), |
| 36 | + dict(type='RandomFlip'), |
| 37 | + dict(type='Normalize', **img_norm_cfg), |
| 38 | + dict(type='ImageToTensor', keys=['img']), |
| 39 | + dict(type='Collect', keys=['img']), |
| 40 | + ]) |
| 41 | +] |
| 42 | +data = dict( |
| 43 | + samples_per_gpu=4, |
| 44 | + workers_per_gpu=4, |
| 45 | + train=dict( |
| 46 | + type=dataset_type, |
| 47 | + data_root=data_root, |
| 48 | + img_dir='img_dir/train', |
| 49 | + ann_dir='ann_dir/train', |
| 50 | + pipeline=train_pipeline), |
| 51 | + val=dict( |
| 52 | + type=dataset_type, |
| 53 | + data_root=data_root, |
| 54 | + img_dir='img_dir/val', |
| 55 | + ann_dir='ann_dir/val', |
| 56 | + pipeline=test_pipeline), |
| 57 | + test=dict( |
| 58 | + type=dataset_type, |
| 59 | + data_root=data_root, |
| 60 | + img_dir='img_dir/val', |
| 61 | + ann_dir='ann_dir/val', |
| 62 | + pipeline=test_pipeline)) |
0 commit comments