|
| 1 | +# dataset settings |
| 2 | +dataset_type = 'NYUDataset' |
| 3 | +data_root = 'data/nyu' |
| 4 | + |
| 5 | +train_pipeline = [ |
| 6 | + dict(type='LoadImageFromFile'), |
| 7 | + dict(type='LoadDepthAnnotation', depth_rescale_factor=1e-3), |
| 8 | + dict(type='RandomDepthMix', prob=0.25), |
| 9 | + dict(type='RandomFlip', prob=0.5), |
| 10 | + dict( |
| 11 | + type='RandomResize', |
| 12 | + scale=(768, 512), |
| 13 | + ratio_range=(0.8, 1.5), |
| 14 | + keep_ratio=True), |
| 15 | + dict(type='RandomCrop', crop_size=(512, 512)), |
| 16 | + dict( |
| 17 | + type='Albu', |
| 18 | + transforms=[ |
| 19 | + dict(type='RandomBrightnessContrast'), |
| 20 | + dict(type='RandomGamma'), |
| 21 | + dict(type='HueSaturationValue'), |
| 22 | + ]), |
| 23 | + dict( |
| 24 | + type='PackSegInputs', |
| 25 | + meta_keys=('img_path', 'depth_map_path', 'ori_shape', 'img_shape', |
| 26 | + 'pad_shape', 'scale_factor', 'flip', 'flip_direction', |
| 27 | + 'category_id')), |
| 28 | +] |
| 29 | + |
| 30 | +test_pipeline = [ |
| 31 | + dict(type='LoadImageFromFile'), |
| 32 | + dict(type='Resize', scale=(2048, 512), keep_ratio=True), |
| 33 | + dict(dict(type='LoadDepthAnnotation', depth_rescale_factor=1e-3)), |
| 34 | + dict( |
| 35 | + type='PackSegInputs', |
| 36 | + meta_keys=('img_path', 'depth_map_path', 'ori_shape', 'img_shape', |
| 37 | + 'pad_shape', 'scale_factor', 'flip', 'flip_direction', |
| 38 | + 'category_id')) |
| 39 | +] |
| 40 | + |
| 41 | +train_dataloader = dict( |
| 42 | + batch_size=8, |
| 43 | + num_workers=8, |
| 44 | + persistent_workers=True, |
| 45 | + sampler=dict(type='InfiniteSampler', shuffle=True), |
| 46 | + dataset=dict( |
| 47 | + type=dataset_type, |
| 48 | + data_root=data_root, |
| 49 | + data_prefix=dict( |
| 50 | + img_path='images/train', depth_map_path='annotations/train'), |
| 51 | + pipeline=train_pipeline)) |
| 52 | + |
| 53 | +val_dataloader = dict( |
| 54 | + batch_size=1, |
| 55 | + num_workers=4, |
| 56 | + persistent_workers=True, |
| 57 | + sampler=dict(type='DefaultSampler', shuffle=False), |
| 58 | + dataset=dict( |
| 59 | + type=dataset_type, |
| 60 | + data_root=data_root, |
| 61 | + test_mode=True, |
| 62 | + data_prefix=dict( |
| 63 | + img_path='images/test', depth_map_path='annotations/test'), |
| 64 | + pipeline=test_pipeline)) |
| 65 | +test_dataloader = val_dataloader |
| 66 | + |
| 67 | +val_evaluator = dict( |
| 68 | + type='DepthMetric', |
| 69 | + min_depth_eval=0.001, |
| 70 | + max_depth_eval=10.0, |
| 71 | + crop_type='nyu_crop') |
| 72 | +test_evaluator = val_evaluator |
0 commit comments