sunrgbd-3d.py 3.37 KB
Newer Older
liyinhao's avatar
liyinhao committed
1
2
3
4
dataset_type = 'SUNRGBDDataset'
data_root = 'data/sunrgbd/'
class_names = ('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser',
               'night_stand', 'bookshelf', 'bathtub')
zhangshilong's avatar
zhangshilong committed
5

6
metainfo = dict(classes=class_names)
zhangshilong's avatar
zhangshilong committed
7

8
9
10
11
12
13
14
15
16
17
18
file_client_args = dict(backend='disk')
# Uncomment the following if use ceph or other file clients.
# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient
# for more details.
# file_client_args = dict(
#     backend='petrel',
#     path_mapping=dict({
#         './data/sunrgbd/':
#         's3://sunrgbd/',
#     }))

liyinhao's avatar
liyinhao committed
19
20
21
train_pipeline = [
    dict(
        type='LoadPointsFromFile',
22
        coord_type='DEPTH',
liyinhao's avatar
liyinhao committed
23
24
25
26
27
        shift_height=True,
        load_dim=6,
        use_dim=[0, 1, 2]),
    dict(type='LoadAnnotations3D'),
    dict(
wuyuefeng's avatar
wuyuefeng committed
28
29
30
31
32
33
34
35
36
        type='RandomFlip3D',
        sync_2d=False,
        flip_ratio_bev_horizontal=0.5,
    ),
    dict(
        type='GlobalRotScaleTrans',
        rot_range=[-0.523599, 0.523599],
        scale_ratio_range=[0.85, 1.15],
        shift_height=True),
37
    dict(type='PointSample', num_points=20000),
zhangshilong's avatar
zhangshilong committed
38
39
40
    dict(
        type='Pack3DDetInputs',
        keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])
liyinhao's avatar
liyinhao committed
41
42
43
44
]
test_pipeline = [
    dict(
        type='LoadPointsFromFile',
45
        coord_type='DEPTH',
liyinhao's avatar
liyinhao committed
46
47
48
        shift_height=True,
        load_dim=6,
        use_dim=[0, 1, 2]),
zhangwenwei's avatar
zhangwenwei committed
49
50
51
52
53
54
55
56
57
58
59
    dict(
        type='MultiScaleFlipAug3D',
        img_scale=(1333, 800),
        pts_scale_ratio=1,
        flip=False,
        transforms=[
            dict(
                type='GlobalRotScaleTrans',
                rot_range=[0, 0],
                scale_ratio_range=[1., 1.],
                translation_std=[0, 0, 0]),
wuyuefeng's avatar
wuyuefeng committed
60
61
62
63
64
            dict(
                type='RandomFlip3D',
                sync_2d=False,
                flip_ratio_bev_horizontal=0.5,
            ),
zhangshilong's avatar
zhangshilong committed
65
66
67
            dict(type='PointSample', num_points=20000)
        ]),
    dict(type='Pack3DDetInputs', keys=['points'])
68
]
liyinhao's avatar
liyinhao committed
69

zhangshilong's avatar
zhangshilong committed
70
71
72
73
74
train_dataloader = dict(
    batch_size=16,
    num_workers=4,
    sampler=dict(type='DefaultSampler', shuffle=True),
    dataset=dict(
liyinhao's avatar
liyinhao committed
75
76
77
78
79
        type='RepeatDataset',
        times=5,
        dataset=dict(
            type=dataset_type,
            data_root=data_root,
zhangshilong's avatar
zhangshilong committed
80
            ann_file='sunrgbd_infos_train.pkl',
liyinhao's avatar
liyinhao committed
81
            pipeline=train_pipeline,
wuyuefeng's avatar
Demo  
wuyuefeng committed
82
            filter_empty_gt=False,
zhangshilong's avatar
zhangshilong committed
83
            metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
84
85
            # we use box_type_3d='LiDAR' in kitti and nuscenes dataset
            # and box_type_3d='Depth' in sunrgbd and scannet dataset.
zhangshilong's avatar
zhangshilong committed
86
87
88
89
90
91
92
            box_type_3d='Depth')))

val_dataloader = dict(
    batch_size=1,
    num_workers=1,
    sampler=dict(type='DefaultSampler', shuffle=False),
    dataset=dict(
liyinhao's avatar
liyinhao committed
93
94
        type=dataset_type,
        data_root=data_root,
zhangshilong's avatar
zhangshilong committed
95
        ann_file='sunrgbd_infos_val.pkl',
liyinhao's avatar
liyinhao committed
96
        pipeline=test_pipeline,
zhangshilong's avatar
zhangshilong committed
97
        metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
98
        test_mode=True,
zhangshilong's avatar
zhangshilong committed
99
100
101
102
103
104
        box_type_3d='Depth'))
test_dataloader = dict(
    batch_size=1,
    num_workers=1,
    sampler=dict(type='DefaultSampler', shuffle=False),
    dataset=dict(
liyinhao's avatar
liyinhao committed
105
106
        type=dataset_type,
        data_root=data_root,
zhangshilong's avatar
zhangshilong committed
107
        ann_file='sunrgbd_infos_val.pkl',
liyinhao's avatar
liyinhao committed
108
        pipeline=test_pipeline,
zhangshilong's avatar
zhangshilong committed
109
        metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
110
111
        test_mode=True,
        box_type_3d='Depth'))
zhangshilong's avatar
zhangshilong committed
112
113
val_evaluator = dict(type='IndoorMetric')
test_evaluator = val_evaluator
114
115
116
117

vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
    type='Det3DLocalVisualizer', vis_backends=vis_backends, name='visualizer')