|
| 1 | +# dataset settings |
| 2 | +dataset_type = 'ImageNetSDataset' |
| 3 | +subset = 919 |
| 4 | +data_root = 'data/ImageNetS/ImageNetS919' |
| 5 | +img_norm_cfg = dict( |
| 6 | + mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) |
| 7 | +crop_size = (224, 224) |
| 8 | +train_pipeline = [ |
| 9 | + dict(type='LoadImageNetSImageFromFile', downsample_large_image=True), |
| 10 | + dict(type='LoadImageNetSAnnotations', reduce_zero_label=False), |
| 11 | + dict(type='Resize', img_scale=(1024, 256), ratio_range=(0.5, 2.0)), |
| 12 | + dict( |
| 13 | + type='RandomCrop', |
| 14 | + crop_size=crop_size, |
| 15 | + cat_max_ratio=0.75, |
| 16 | + ignore_index=1000), |
| 17 | + dict(type='RandomFlip', prob=0.5), |
| 18 | + dict(type='PhotoMetricDistortion'), |
| 19 | + dict(type='Normalize', **img_norm_cfg), |
| 20 | + dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=1000), |
| 21 | + dict(type='DefaultFormatBundle'), |
| 22 | + dict(type='Collect', keys=['img', 'gt_semantic_seg']), |
| 23 | +] |
| 24 | +test_pipeline = [ |
| 25 | + dict(type='LoadImageNetSImageFromFile', downsample_large_image=True), |
| 26 | + dict( |
| 27 | + type='MultiScaleFlipAug', |
| 28 | + img_scale=(1024, 256), |
| 29 | + flip=False, |
| 30 | + transforms=[ |
| 31 | + dict(type='Resize', keep_ratio=True), |
| 32 | + dict(type='RandomFlip'), |
| 33 | + dict(type='Normalize', **img_norm_cfg), |
| 34 | + dict(type='ImageToTensor', keys=['img']), |
| 35 | + dict(type='Collect', keys=['img']), |
| 36 | + ]) |
| 37 | +] |
| 38 | +data = dict( |
| 39 | + samples_per_gpu=4, |
| 40 | + workers_per_gpu=4, |
| 41 | + train=dict( |
| 42 | + type=dataset_type, |
| 43 | + subset=subset, |
| 44 | + data_root=data_root, |
| 45 | + img_dir='train-semi', |
| 46 | + ann_dir='train-semi-segmentation', |
| 47 | + pipeline=train_pipeline), |
| 48 | + val=dict( |
| 49 | + type=dataset_type, |
| 50 | + subset=subset, |
| 51 | + data_root=data_root, |
| 52 | + img_dir='validation', |
| 53 | + ann_dir='validation-segmentation', |
| 54 | + pipeline=test_pipeline), |
| 55 | + test=dict( |
| 56 | + type=dataset_type, |
| 57 | + subset=subset, |
| 58 | + data_root=data_root, |
| 59 | + img_dir='validation', |
| 60 | + ann_dir='validation-segmentation', |
| 61 | + pipeline=test_pipeline)) |
0 commit comments