sunrgbd-3d-10class.py 2.9 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
7

metainfo = dict(CLASSES=class_names)

liyinhao's avatar
liyinhao committed
8
9
10
train_pipeline = [
    dict(
        type='LoadPointsFromFile',
11
        coord_type='DEPTH',
liyinhao's avatar
liyinhao committed
12
13
14
15
16
        shift_height=True,
        load_dim=6,
        use_dim=[0, 1, 2]),
    dict(type='LoadAnnotations3D'),
    dict(
wuyuefeng's avatar
wuyuefeng committed
17
18
19
20
21
22
23
24
25
        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),
26
    dict(type='PointSample', num_points=20000),
zhangshilong's avatar
zhangshilong committed
27
28
29
    dict(
        type='Pack3DDetInputs',
        keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])
liyinhao's avatar
liyinhao committed
30
31
32
33
]
test_pipeline = [
    dict(
        type='LoadPointsFromFile',
34
        coord_type='DEPTH',
liyinhao's avatar
liyinhao committed
35
36
37
        shift_height=True,
        load_dim=6,
        use_dim=[0, 1, 2]),
zhangwenwei's avatar
zhangwenwei committed
38
39
40
41
42
43
44
45
46
47
48
    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
49
50
51
52
53
            dict(
                type='RandomFlip3D',
                sync_2d=False,
                flip_ratio_bev_horizontal=0.5,
            ),
zhangshilong's avatar
zhangshilong committed
54
55
56
            dict(type='PointSample', num_points=20000)
        ]),
    dict(type='Pack3DDetInputs', keys=['points'])
57
]
liyinhao's avatar
liyinhao committed
58

zhangshilong's avatar
zhangshilong committed
59
60
61
62
63
train_dataloader = dict(
    batch_size=16,
    num_workers=4,
    sampler=dict(type='DefaultSampler', shuffle=True),
    dataset=dict(
liyinhao's avatar
liyinhao committed
64
65
66
67
68
        type='RepeatDataset',
        times=5,
        dataset=dict(
            type=dataset_type,
            data_root=data_root,
zhangshilong's avatar
zhangshilong committed
69
            ann_file='sunrgbd_infos_train.pkl',
liyinhao's avatar
liyinhao committed
70
            pipeline=train_pipeline,
wuyuefeng's avatar
Demo  
wuyuefeng committed
71
            filter_empty_gt=False,
zhangshilong's avatar
zhangshilong committed
72
            metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
73
74
            # 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
75
76
77
78
79
80
81
            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
82
83
        type=dataset_type,
        data_root=data_root,
zhangshilong's avatar
zhangshilong committed
84
        ann_file='sunrgbd_infos_val.pkl',
liyinhao's avatar
liyinhao committed
85
        pipeline=test_pipeline,
zhangshilong's avatar
zhangshilong committed
86
        metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
87
        test_mode=True,
zhangshilong's avatar
zhangshilong committed
88
89
90
91
92
93
        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
94
95
        type=dataset_type,
        data_root=data_root,
zhangshilong's avatar
zhangshilong committed
96
        ann_file='sunrgbd_infos_val.pkl',
liyinhao's avatar
liyinhao committed
97
        pipeline=test_pipeline,
zhangshilong's avatar
zhangshilong committed
98
        metainfo=metainfo,
wuyuefeng's avatar
Demo  
wuyuefeng committed
99
100
        test_mode=True,
        box_type_3d='Depth'))
zhangshilong's avatar
zhangshilong committed
101
102
val_evaluator = dict(type='IndoorMetric')
test_evaluator = val_evaluator