Skip to content

Commit e943e84

Browse files
authoredMar 15, 2023
[Enhance] Format semantickitti label mapping (open-mmlab#2323)
* fix polarmix UT * format * rename SemanticKittiDataset * add platte & fix data info bug * fix ut * fix semantic_kitti ut * fix ut label_map * fix ut label_map * add indication * add indication * fix typo
1 parent 0b42e35 commit e943e84

File tree

7 files changed

+144
-212
lines changed

7 files changed

+144
-212
lines changed
 
+61-70
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,53 @@
1-
# dataset settings
2-
dataset_type = 'SemanticKITTIDataset'
1+
# For SemanticKitti we usually do 19-class segmentation.
2+
# For labels_map we follow the uniform format of MMDetection & MMSegmentation
3+
# i.e. we consider the unlabeled class as the last one, which is different
4+
# from the original implementation of some methods e.g. Cylinder3D.
5+
dataset_type = 'SemanticKittiDataset'
36
data_root = 'data/semantickitti/'
47
class_names = [
5-
'unlabeled', 'car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person',
6-
'bicyclist', 'motorcyclist', 'road', 'parking', 'sidewalk', 'other-ground',
7-
'building', 'fence', 'vegetation', 'trunck', 'terrian', 'pole',
8-
'traffic-sign'
8+
'car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person', 'bicyclist',
9+
'motorcyclist', 'road', 'parking', 'sidewalk', 'other-ground', 'building',
10+
'fence', 'vegetation', 'trunck', 'terrian', 'pole', 'traffic-sign'
911
]
10-
palette = [
11-
[174, 199, 232],
12-
[152, 223, 138],
13-
[31, 119, 180],
14-
[255, 187, 120],
15-
[188, 189, 34],
16-
[140, 86, 75],
17-
[255, 152, 150],
18-
[214, 39, 40],
19-
[197, 176, 213],
20-
[148, 103, 189],
21-
[196, 156, 148],
22-
[23, 190, 207],
23-
[247, 182, 210],
24-
[219, 219, 141],
25-
[255, 127, 14],
26-
[158, 218, 229],
27-
[44, 160, 44],
28-
[112, 128, 144],
29-
[227, 119, 194],
30-
[82, 84, 163],
31-
]
32-
3312
labels_map = {
34-
0: 0, # "unlabeled"
35-
1: 0, # "outlier" mapped to "unlabeled" --------------mapped
36-
10: 1, # "car"
37-
11: 2, # "bicycle"
38-
13: 5, # "bus" mapped to "other-vehicle" --------------mapped
39-
15: 3, # "motorcycle"
40-
16: 5, # "on-rails" mapped to "other-vehicle" ---------mapped
41-
18: 4, # "truck"
42-
20: 5, # "other-vehicle"
43-
30: 6, # "person"
44-
31: 7, # "bicyclist"
45-
32: 8, # "motorcyclist"
46-
40: 9, # "road"
47-
44: 10, # "parking"
48-
48: 11, # "sidewalk"
49-
49: 12, # "other-ground"
50-
50: 13, # "building"
51-
51: 14, # "fence"
52-
52: 0, # "other-structure" mapped to "unlabeled" ------mapped
53-
60: 9, # "lane-marking" to "road" ---------------------mapped
54-
70: 15, # "vegetation"
55-
71: 16, # "trunk"
56-
72: 17, # "terrain"
57-
80: 18, # "pole"
58-
81: 19, # "traffic-sign"
59-
99: 0, # "other-object" to "unlabeled" ----------------mapped
60-
252: 1, # "moving-car" to "car" ------------------------mapped
61-
253: 7, # "moving-bicyclist" to "bicyclist" ------------mapped
62-
254: 6, # "moving-person" to "person" ------------------mapped
63-
255: 8, # "moving-motorcyclist" to "motorcyclist" ------mapped
64-
256: 5, # "moving-on-rails" mapped to "other-vehic------mapped
65-
257: 5, # "moving-bus" mapped to "other-vehicle" -------mapped
66-
258: 4, # "moving-truck" to "truck" --------------------mapped
67-
259: 5 # "moving-other"-vehicle to "other-vehicle"-----mapped
13+
0: 19, # "unlabeled"
14+
1: 19, # "outlier" mapped to "unlabeled" --------------mapped
15+
10: 0, # "car"
16+
11: 1, # "bicycle"
17+
13: 4, # "bus" mapped to "other-vehicle" --------------mapped
18+
15: 2, # "motorcycle"
19+
16: 4, # "on-rails" mapped to "other-vehicle" ---------mapped
20+
18: 3, # "truck"
21+
20: 4, # "other-vehicle"
22+
30: 5, # "person"
23+
31: 6, # "bicyclist"
24+
32: 7, # "motorcyclist"
25+
40: 8, # "road"
26+
44: 9, # "parking"
27+
48: 10, # "sidewalk"
28+
49: 11, # "other-ground"
29+
50: 12, # "building"
30+
51: 13, # "fence"
31+
52: 19, # "other-structure" mapped to "unlabeled" ------mapped
32+
60: 8, # "lane-marking" to "road" ---------------------mapped
33+
70: 14, # "vegetation"
34+
71: 15, # "trunk"
35+
72: 16, # "terrain"
36+
80: 17, # "pole"
37+
81: 18, # "traffic-sign"
38+
99: 19, # "other-object" to "unlabeled" ----------------mapped
39+
252: 0, # "moving-car" to "car" ------------------------mapped
40+
253: 6, # "moving-bicyclist" to "bicyclist" ------------mapped
41+
254: 5, # "moving-person" to "person" ------------------mapped
42+
255: 7, # "moving-motorcyclist" to "motorcyclist" ------mapped
43+
256: 4, # "moving-on-rails" mapped to "other-vehic------mapped
44+
257: 4, # "moving-bus" mapped to "other-vehicle" -------mapped
45+
258: 3, # "moving-truck" to "truck" --------------------mapped
46+
259: 4 # "moving-other"-vehicle to "other-vehicle"-----mapped
6847
}
6948

7049
metainfo = dict(
71-
classes=class_names,
72-
palette=palette,
73-
seg_label_mapping=labels_map,
74-
max_label=259)
50+
classes=class_names, seg_label_mapping=labels_map, max_label=259)
7551

7652
input_modality = dict(use_lidar=True, use_camera=False)
7753

@@ -99,7 +75,10 @@
9975
backend_args=backend_args),
10076
dict(
10177
type='LoadAnnotations3D',
78+
with_bbox_3d=False,
79+
with_label_3d=False,
10280
with_seg_3d=True,
81+
seg_3d_dtype='np.int32',
10382
seg_offset=2**16,
10483
dataset_type='semantickitti',
10584
backend_args=backend_args),
@@ -126,7 +105,10 @@
126105
backend_args=backend_args),
127106
dict(
128107
type='LoadAnnotations3D',
108+
with_bbox_3d=False,
109+
with_label_3d=False,
129110
with_seg_3d=True,
111+
seg_3d_dtype='np.int32',
130112
seg_offset=2**16,
131113
dataset_type='semantickitti',
132114
backend_args=backend_args),
@@ -144,7 +126,10 @@
144126
backend_args=backend_args),
145127
dict(
146128
type='LoadAnnotations3D',
129+
with_bbox_3d=False,
130+
with_label_3d=False,
147131
with_seg_3d=True,
132+
seg_3d_dtype='np.int32',
148133
seg_offset=2**16,
149134
dataset_type='semantickitti',
150135
backend_args=backend_args),
@@ -153,7 +138,7 @@
153138
]
154139

155140
train_dataloader = dict(
156-
batch_size=4,
141+
batch_size=2,
157142
num_workers=4,
158143
sampler=dict(type='DefaultSampler', shuffle=True),
159144
dataset=dict(
@@ -162,10 +147,11 @@
162147
dataset=dict(
163148
type=dataset_type,
164149
data_root=data_root,
165-
ann_file='train_infos.pkl',
150+
ann_file='semantickitti_infos_train.pkl',
166151
pipeline=train_pipeline,
167152
metainfo=metainfo,
168153
modality=input_modality,
154+
ignore_index=19,
169155
backend_args=backend_args)),
170156
)
171157

@@ -179,10 +165,11 @@
179165
dataset=dict(
180166
type=dataset_type,
181167
data_root=data_root,
182-
ann_file='valid_infos.pkl',
168+
ann_file='semantickitti_infos_val.pkl',
183169
pipeline=test_pipeline,
184170
metainfo=metainfo,
185171
modality=input_modality,
172+
ignore_index=19,
186173
test_mode=True,
187174
backend_args=backend_args)),
188175
)
@@ -191,3 +178,7 @@
191178

192179
val_evaluator = dict(type='SegMetric')
193180
test_evaluator = val_evaluator
181+
182+
vis_backends = [dict(type='LocalVisBackend')]
183+
visualizer = dict(
184+
type='Det3DLocalVisualizer', vis_backends=vis_backends, name='visualizer')

‎mmdet3d/datasets/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .scannet_dataset import (ScanNetDataset, ScanNetInstanceSegDataset,
1010
ScanNetSegDataset)
1111
from .seg3d_dataset import Seg3DDataset
12-
from .semantickitti_dataset import SemanticKITTIDataset
12+
from .semantickitti_dataset import SemanticKittiDataset
1313
from .sunrgbd_dataset import SUNRGBDDataset
1414
# yapf: disable
1515
from .transforms import (AffineResize, BackgroundPointsFilter, GlobalAlignment,
@@ -33,7 +33,7 @@
3333
'NormalizePointsColor', 'IndoorPatchPointSample', 'IndoorPointSample',
3434
'PointSample', 'LoadAnnotations3D', 'GlobalAlignment', 'SUNRGBDDataset',
3535
'ScanNetDataset', 'ScanNetSegDataset', 'ScanNetInstanceSegDataset',
36-
'SemanticKITTIDataset', 'Det3DDataset', 'Seg3DDataset',
36+
'SemanticKittiDataset', 'Det3DDataset', 'Seg3DDataset',
3737
'LoadPointsFromMultiSweeps', 'WaymoDataset', 'BackgroundPointsFilter',
3838
'VoxelBasedPointSampler', 'get_loading_pipeline', 'RandomDropPointsColor',
3939
'RandomJitterPoints', 'ObjectNameFilter', 'AffineResize',

‎mmdet3d/datasets/seg3d_dataset.py

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def parse_data_info(self, info: dict) -> dict:
256256
self.data_prefix.get('pts', ''),
257257
info['lidar_points']['lidar_path'])
258258

259+
info['num_pts_feats'] = info['lidar_points']['num_pts_feats']
260+
info['lidar_path'] = info['lidar_points']['lidar_path']
261+
259262
if self.modality['use_camera']:
260263
for cam_id, img_info in info['images'].items():
261264
if 'img_path' in img_info:

‎mmdet3d/datasets/semantickitti_dataset.py

+16-10
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
@DATASETS.register_module()
11-
class SemanticKITTIDataset(Seg3DDataset):
12-
r"""SemanticKITTI Dataset.
11+
class SemanticKittiDataset(Seg3DDataset):
12+
r"""SemanticKitti Dataset.
1313
1414
This class serves as the API for experiments on the SemanticKITTI Dataset
1515
Please refer to <http://www.semantic-kitti.org/dataset.html>`_
@@ -44,22 +44,28 @@ class SemanticKITTIDataset(Seg3DDataset):
4444
Defaults to False.
4545
"""
4646
METAINFO = {
47-
'classes': ('unlabeled', 'car', 'bicycle', 'motorcycle', 'truck',
48-
'bus', 'person', 'bicyclist', 'motorcyclist', 'road',
49-
'parking', 'sidewalk', 'other-ground', 'building', 'fence',
50-
'vegetation', 'trunck', 'terrian', 'pole', 'traffic-sign'),
47+
'classes': ('car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person',
48+
'bicyclist', 'motorcyclist', 'road', 'parking', 'sidewalk',
49+
'other-ground', 'building', 'fence', 'vegetation',
50+
'trunck', 'terrian', 'pole', 'traffic-sign'),
51+
'palette': [[100, 150, 245], [100, 230, 245], [30, 60, 150],
52+
[80, 30, 180], [100, 80, 250], [155, 30, 30],
53+
[255, 40, 200], [150, 30, 90], [255, 0, 255],
54+
[255, 150, 255], [75, 0, 75], [175, 0, 75], [255, 200, 0],
55+
[255, 120, 50], [0, 175, 0], [135, 60, 0], [150, 240, 80],
56+
[255, 240, 150], [255, 0, 0]],
5157
'seg_valid_class_ids':
52-
tuple(range(20)),
58+
tuple(range(19)),
5359
'seg_all_class_ids':
54-
tuple(range(20)),
60+
tuple(range(19)),
5561
}
5662

5763
def __init__(self,
5864
data_root: Optional[str] = None,
5965
ann_file: str = '',
6066
metainfo: Optional[dict] = None,
6167
data_prefix: dict = dict(
62-
pts='points',
68+
pts='',
6369
img='',
6470
pts_instance_mask='',
6571
pts_semantic_mask=''),
@@ -83,7 +89,7 @@ def __init__(self,
8389
**kwargs)
8490

8591
def get_seg_label_mapping(self, metainfo):
86-
seg_label_mapping = np.zeros(metainfo['max_label'] + 1)
92+
seg_label_mapping = np.zeros(metainfo['max_label'] + 1, dtype=np.int64)
8793
for idx in metainfo['seg_label_mapping']:
8894
seg_label_mapping[idx] = metainfo['seg_label_mapping'][idx]
8995
return seg_label_mapping

‎tests/test_datasets/test_semantickitti_dataset.py

+48-72
Original file line numberDiff line numberDiff line change
@@ -3,75 +3,53 @@
33

44
import numpy as np
55

6-
from mmdet3d.datasets import SemanticKITTIDataset
6+
from mmdet3d.datasets import SemanticKittiDataset
77
from mmdet3d.utils import register_all_modules
88

99

1010
def _generate_semantickitti_dataset_config():
1111
data_root = './tests/data/semantickitti/'
1212
ann_file = 'semantickitti_infos.pkl'
13-
classes = ('unlabeled', 'car', 'bicycle', 'motorcycle', 'truck', 'bus',
14-
'person', 'bicyclist', 'motorcyclist', 'road', 'parking',
15-
'sidewalk', 'other-ground', 'building', 'fence', 'vegetation',
16-
'trunck', 'terrian', 'pole', 'traffic-sign')
17-
palette = [
18-
[174, 199, 232],
19-
[152, 223, 138],
20-
[31, 119, 180],
21-
[255, 187, 120],
22-
[188, 189, 34],
23-
[140, 86, 75],
24-
[255, 152, 150],
25-
[214, 39, 40],
26-
[197, 176, 213],
27-
[148, 103, 189],
28-
[196, 156, 148],
29-
[23, 190, 207],
30-
[247, 182, 210],
31-
[219, 219, 141],
32-
[255, 127, 14],
33-
[158, 218, 229],
34-
[44, 160, 44],
35-
[112, 128, 144],
36-
[227, 119, 194],
37-
[82, 84, 163],
38-
]
13+
classes = ('car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person',
14+
'bicyclist', 'motorcyclist', 'road', 'parking', 'sidewalk',
15+
'other-ground', 'building', 'fence', 'vegetation', 'trunck',
16+
'terrian', 'pole', 'traffic-sign')
3917

4018
seg_label_mapping = {
41-
0: 0, # "unlabeled"
42-
1: 0, # "outlier" mapped to "unlabeled" --------------mapped
43-
10: 1, # "car"
44-
11: 2, # "bicycle"
45-
13: 5, # "bus" mapped to "other-vehicle" --------------mapped
46-
15: 3, # "motorcycle"
47-
16: 5, # "on-rails" mapped to "other-vehicle" ---------mapped
48-
18: 4, # "truck"
49-
20: 5, # "other-vehicle"
50-
30: 6, # "person"
51-
31: 7, # "bicyclist"
52-
32: 8, # "motorcyclist"
53-
40: 9, # "road"
54-
44: 10, # "parking"
55-
48: 11, # "sidewalk"
56-
49: 12, # "other-ground"
57-
50: 13, # "building"
58-
51: 14, # "fence"
59-
52: 0, # "other-structure" mapped to "unlabeled" ------mapped
60-
60: 9, # "lane-marking" to "road" ---------------------mapped
61-
70: 15, # "vegetation"
62-
71: 16, # "trunk"
63-
72: 17, # "terrain"
64-
80: 18, # "pole"
65-
81: 19, # "traffic-sign"
66-
99: 0, # "other-object" to "unlabeled" ----------------mapped
67-
252: 1, # "moving-car" to "car" ------------------------mapped
68-
253: 7, # "moving-bicyclist" to "bicyclist" ------------mapped
69-
254: 6, # "moving-person" to "person" ------------------mapped
70-
255: 8, # "moving-motorcyclist" to "motorcyclist" ------mapped
71-
256: 5, # "moving-on-rails" mapped to "other-vehic------mapped
72-
257: 5, # "moving-bus" mapped to "other-vehicle" -------mapped
73-
258: 4, # "moving-truck" to "truck" --------------------mapped
74-
259: 5 # "moving-other"-vehicle to "other-vehicle"-----mapped
19+
0: 19, # "unlabeled"
20+
1: 19, # "outlier" mapped to "unlabeled" --------------mapped
21+
10: 0, # "car"
22+
11: 1, # "bicycle"
23+
13: 4, # "bus" mapped to "other-vehicle" --------------mapped
24+
15: 2, # "motorcycle"
25+
16: 4, # "on-rails" mapped to "other-vehicle" ---------mapped
26+
18: 3, # "truck"
27+
20: 4, # "other-vehicle"
28+
30: 5, # "person"
29+
31: 6, # "bicyclist"
30+
32: 7, # "motorcyclist"
31+
40: 8, # "road"
32+
44: 9, # "parking"
33+
48: 10, # "sidewalk"
34+
49: 11, # "other-ground"
35+
50: 12, # "building"
36+
51: 13, # "fence"
37+
52: 19, # "other-structure" mapped to "unlabeled" ------mapped
38+
60: 8, # "lane-marking" to "road" ---------------------mapped
39+
70: 14, # "vegetation"
40+
71: 15, # "trunk"
41+
72: 16, # "terrain"
42+
80: 17, # "pole"
43+
81: 18, # "traffic-sign"
44+
99: 19, # "other-object" to "unlabeled" ----------------mapped
45+
252: 0, # "moving-car" to "car" ------------------------mapped
46+
253: 6, # "moving-bicyclist" to "bicyclist" ------------mapped
47+
254: 5, # "moving-person" to "person" ------------------mapped
48+
255: 7, # "moving-motorcyclist" to "motorcyclist" ------mapped
49+
256: 4, # "moving-on-rails" mapped to "other-vehic------mapped
50+
257: 4, # "moving-bus" mapped to "other-vehicle" -------mapped
51+
258: 3, # "moving-truck" to "truck" --------------------mapped
52+
259: 4 # "moving-other"-vehicle to "other-vehicle"-----mapped
7553
}
7654
max_label = 259
7755
modality = dict(use_lidar=True, use_camera=False)
@@ -96,25 +74,24 @@ def _generate_semantickitti_dataset_config():
9674
data_prefix = dict(
9775
pts='sequences/00/velodyne', pts_semantic_mask='sequences/00/labels')
9876

99-
return (data_root, ann_file, classes, palette, data_prefix, pipeline,
100-
modality, seg_label_mapping, max_label)
77+
return (data_root, ann_file, classes, data_prefix, pipeline, modality,
78+
seg_label_mapping, max_label)
10179

10280

103-
class TestSemanticKITTIDataset(unittest.TestCase):
81+
class TestSemanticKittiDataset(unittest.TestCase):
10482

10583
def test_semantickitti(self):
106-
(data_root, ann_file, classes, palette, data_prefix, pipeline,
107-
modality, seg_label_mapping,
84+
(data_root, ann_file, classes, data_prefix, pipeline, modality,
85+
seg_label_mapping,
10886
max_label) = _generate_semantickitti_dataset_config()
10987

11088
register_all_modules()
11189
np.random.seed(0)
112-
semantickitti_dataset = SemanticKITTIDataset(
90+
semantickitti_dataset = SemanticKittiDataset(
11391
data_root,
11492
ann_file,
11593
metainfo=dict(
11694
classes=classes,
117-
palette=palette,
11895
seg_label_mapping=seg_label_mapping,
11996
max_label=max_label),
12097
data_prefix=data_prefix,
@@ -129,10 +106,9 @@ def test_semantickitti(self):
129106
self.assertEqual(points.shape[0], pts_semantic_mask.shape[0])
130107

131108
expected_pts_semantic_mask = np.array([
132-
13., 13., 13., 15., 15., 13., 0., 13., 15., 13., 13., 15., 16., 0.,
133-
15., 13., 13., 13., 13., 0., 13., 13., 13., 13., 13., 15., 13.,
134-
16., 13., 15., 15., 18., 13., 15., 15., 15., 16., 15., 13., 13.,
135-
15., 13., 18., 15., 13., 15., 13., 15., 15., 13.
109+
12, 12, 12, 14, 14, 12, 19, 12, 14, 12, 12, 14, 15, 19, 14, 12, 12,
110+
12, 12, 19, 12, 12, 12, 12, 12, 14, 12, 15, 12, 14, 14, 17, 12, 14,
111+
14, 14, 15, 14, 12, 12, 14, 12, 17, 14, 12, 14, 12, 14, 14, 12
136112
])
137113

138114
self.assertTrue(

‎tests/test_datasets/test_transforms/test_transforms_3d.py

+11-57
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from mmengine.testing import assert_allclose
88

99
from mmdet3d.datasets import (GlobalAlignment, RandomFlip3D,
10-
SemanticKITTIDataset)
10+
SemanticKittiDataset)
1111
from mmdet3d.datasets.transforms import GlobalRotScaleTrans, LaserMix, PolarMix
1212
from mmdet3d.structures import LiDARPoints
1313
from mmdet3d.testing import create_data_info_after_loading
@@ -124,32 +124,10 @@ def setUp(self):
124124
seg_3d_dtype='np.int32'),
125125
dict(type='PointSegClassMapping'),
126126
]
127-
classes = ('unlabeled', 'car', 'bicycle', 'motorcycle', 'truck', 'bus',
128-
'person', 'bicyclist', 'motorcyclist', 'road', 'parking',
129-
'sidewalk', 'other-ground', 'building', 'fence',
130-
'vegetation', 'trunck', 'terrian', 'pole', 'traffic-sign')
131-
palette = [
132-
[174, 199, 232],
133-
[152, 223, 138],
134-
[31, 119, 180],
135-
[255, 187, 120],
136-
[188, 189, 34],
137-
[140, 86, 75],
138-
[255, 152, 150],
139-
[214, 39, 40],
140-
[197, 176, 213],
141-
[148, 103, 189],
142-
[196, 156, 148],
143-
[23, 190, 207],
144-
[247, 182, 210],
145-
[219, 219, 141],
146-
[255, 127, 14],
147-
[158, 218, 229],
148-
[44, 160, 44],
149-
[112, 128, 144],
150-
[227, 119, 194],
151-
[82, 84, 163],
152-
]
127+
classes = ('car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person',
128+
'bicyclist', 'motorcyclist', 'road', 'parking', 'sidewalk',
129+
'other-ground', 'building', 'fence', 'vegetation', 'trunck',
130+
'terrian', 'pole', 'traffic-sign')
153131
seg_label_mapping = {
154132
0: 0, # "unlabeled"
155133
1: 0, # "outlier" mapped to "unlabeled" --------------mapped
@@ -187,12 +165,11 @@ def setUp(self):
187165
259: 5 # "moving-other"-vehicle to "other-vehicle"-----mapped
188166
}
189167
max_label = 259
190-
self.dataset = SemanticKITTIDataset(
168+
self.dataset = SemanticKittiDataset(
191169
'./tests/data/semantickitti/',
192170
'semantickitti_infos.pkl',
193171
metainfo=dict(
194172
classes=classes,
195-
palette=palette,
196173
seg_label_mapping=seg_label_mapping,
197174
max_label=max_label),
198175
data_prefix=dict(
@@ -242,32 +219,10 @@ def setUp(self):
242219
seg_3d_dtype='np.int32'),
243220
dict(type='PointSegClassMapping'),
244221
]
245-
classes = ('unlabeled', 'car', 'bicycle', 'motorcycle', 'truck', 'bus',
246-
'person', 'bicyclist', 'motorcyclist', 'road', 'parking',
247-
'sidewalk', 'other-ground', 'building', 'fence',
248-
'vegetation', 'trunck', 'terrian', 'pole', 'traffic-sign')
249-
palette = [
250-
[174, 199, 232],
251-
[152, 223, 138],
252-
[31, 119, 180],
253-
[255, 187, 120],
254-
[188, 189, 34],
255-
[140, 86, 75],
256-
[255, 152, 150],
257-
[214, 39, 40],
258-
[197, 176, 213],
259-
[148, 103, 189],
260-
[196, 156, 148],
261-
[23, 190, 207],
262-
[247, 182, 210],
263-
[219, 219, 141],
264-
[255, 127, 14],
265-
[158, 218, 229],
266-
[44, 160, 44],
267-
[112, 128, 144],
268-
[227, 119, 194],
269-
[82, 84, 163],
270-
]
222+
classes = ('car', 'bicycle', 'motorcycle', 'truck', 'bus', 'person',
223+
'bicyclist', 'motorcyclist', 'road', 'parking', 'sidewalk',
224+
'other-ground', 'building', 'fence', 'vegetation', 'trunck',
225+
'terrian', 'pole', 'traffic-sign')
271226
seg_label_mapping = {
272227
0: 0, # "unlabeled"
273228
1: 0, # "outlier" mapped to "unlabeled" --------------mapped
@@ -305,12 +260,11 @@ def setUp(self):
305260
259: 5 # "moving-other"-vehicle to "other-vehicle"-----mapped
306261
}
307262
max_label = 259
308-
self.dataset = SemanticKITTIDataset(
263+
self.dataset = SemanticKittiDataset(
309264
'./tests/data/semantickitti/',
310265
'semantickitti_infos.pkl',
311266
metainfo=dict(
312267
classes=classes,
313-
palette=palette,
314268
seg_label_mapping=seg_label_mapping,
315269
max_label=max_label),
316270
data_prefix=dict(

‎tools/dataset_converters/semantickitti_converter.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def get_semantickitti_info(split):
6262
'lidar_path':
6363
osp.join('sequences',
6464
str(i_folder).zfill(2), 'velodyne',
65-
str(j).zfill(6) + '.bin')
65+
str(j).zfill(6) + '.bin'),
66+
'num_pts_feats':
67+
4
6668
},
6769
'pts_semantic_mask_path':
6870
osp.join('sequences',

0 commit comments

Comments
 (0)
Please sign in to comment.