Skip to content

Commit 3365d7e

Browse files
[Feature]Add Lidarseg benchmark (#2530)
* enhance minkunet * add 2x * add config * add flip... * add bottleneck * add spvcnn & cylinder3d * add spvcnn & cylinder3d * refactor minkunet & spvcnn * add minkv2 * fix mink34 shared res block * add mink spconv * fix spconv int32 max bug * fix spconv int32 max bug2 * add minkowski backends * rename config * fix minkv2 config * fix max voxel bug * add checkpointhook mink18 * add backbone docstring * fix torchsparse uninstall bug * remove ME * fix ut * fix cylinder3d config
1 parent 3fa4dc1 commit 3365d7e

31 files changed

+731
-258
lines changed

configs/_base_/models/minkunet.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
type='Det3DDataPreprocessor',
55
voxel=True,
66
voxel_type='minkunet',
7+
batch_first=False,
8+
max_voxels=80000,
79
voxel_layer=dict(
810
max_num_points=-1,
911
point_cloud_range=[-100, -100, -20, 100, 100, 20],
1012
voxel_size=[0.05, 0.05, 0.05],
11-
max_voxels=(-1, -1)),
12-
max_voxels=80000),
13+
max_voxels=(-1, -1))),
1314
backbone=dict(
1415
type='MinkUNetBackbone',
1516
in_channels=4,
16-
base_channels=32,
1717
num_stages=4,
18+
base_channels=32,
1819
encoder_channels=[32, 64, 128, 256],
19-
decoder_channels=[256, 128, 96, 96]),
20+
encoder_blocks=[2, 2, 2, 2],
21+
decoder_channels=[256, 128, 96, 96],
22+
decoder_blocks=[2, 2, 2, 2],
23+
block_type='basic',
24+
sparseconv_backend='torchsparse'),
2025
decode_head=dict(
2126
type='MinkUNetHead',
2227
channels=96,

configs/_base_/models/spvcnn.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
type='Det3DDataPreprocessor',
55
voxel=True,
66
voxel_type='minkunet',
7+
batch_first=False,
8+
max_voxels=80000,
79
voxel_layer=dict(
810
max_num_points=-1,
911
point_cloud_range=[-100, -100, -20, 100, 100, 20],
1012
voxel_size=[0.05, 0.05, 0.05],
11-
max_voxels=(-1, -1)),
12-
max_voxels=80000),
13+
max_voxels=(-1, -1))),
1314
backbone=dict(
1415
type='SPVCNNBackbone',
1516
in_channels=4,
16-
base_channels=32,
1717
num_stages=4,
18+
base_channels=32,
1819
encoder_channels=[32, 64, 128, 256],
20+
encoder_blocks=[2, 2, 2, 2],
1921
decoder_channels=[256, 128, 96, 96],
22+
decoder_blocks=[2, 2, 2, 2],
23+
block_type='basic',
24+
sparseconv_backend='torchsparse',
2025
drop_ratio=0.3),
2126
decode_head=dict(
2227
type='MinkUNetHead',

configs/_base_/schedules/schedule-3x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
clip_grad=dict(max_norm=10, norm_type=2),
99
)
1010

11-
# training schedule for 1x
11+
# training schedule for 3x
1212
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=36, val_interval=1)
1313
val_cfg = dict(type='ValLoop')
1414
test_cfg = dict(type='TestLoop')

configs/cylinder3d/cylinder3d_4xb4_3x_semantickitti.py renamed to configs/cylinder3d/cylinder3d_4xb4-3x_semantickitti.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
]
55

66
# optimizer
7-
# This schedule is mainly used by models on nuScenes dataset
87
lr = 0.001
98
optim_wrapper = dict(
109
type='OptimWrapper',
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
_base_ = [
2+
'../_base_/datasets/semantickitti.py', '../_base_/models/cylinder3d.py',
3+
'../_base_/schedules/schedule-3x.py', '../_base_/default_runtime.py'
4+
]
5+
6+
train_pipeline = [
7+
dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
8+
dict(
9+
type='LoadAnnotations3D',
10+
with_bbox_3d=False,
11+
with_label_3d=False,
12+
with_seg_3d=True,
13+
seg_3d_dtype='np.int32',
14+
seg_offset=2**16,
15+
dataset_type='semantickitti'),
16+
dict(type='PointSegClassMapping'),
17+
dict(
18+
type='RandomChoice',
19+
transforms=[
20+
[
21+
dict(
22+
type='LaserMix',
23+
num_areas=[3, 4, 5, 6],
24+
pitch_angles=[-25, 3],
25+
pre_transform=[
26+
dict(
27+
type='LoadPointsFromFile',
28+
coord_type='LIDAR',
29+
load_dim=4,
30+
use_dim=4),
31+
dict(
32+
type='LoadAnnotations3D',
33+
with_bbox_3d=False,
34+
with_label_3d=False,
35+
with_seg_3d=True,
36+
seg_3d_dtype='np.int32',
37+
seg_offset=2**16,
38+
dataset_type='semantickitti'),
39+
dict(type='PointSegClassMapping')
40+
],
41+
prob=1)
42+
],
43+
[
44+
dict(
45+
type='PolarMix',
46+
instance_classes=[0, 1, 2, 3, 4, 5, 6, 7],
47+
swap_ratio=0.5,
48+
rotate_paste_ratio=1.0,
49+
pre_transform=[
50+
dict(
51+
type='LoadPointsFromFile',
52+
coord_type='LIDAR',
53+
load_dim=4,
54+
use_dim=4),
55+
dict(
56+
type='LoadAnnotations3D',
57+
with_bbox_3d=False,
58+
with_label_3d=False,
59+
with_seg_3d=True,
60+
seg_3d_dtype='np.int32',
61+
seg_offset=2**16,
62+
dataset_type='semantickitti'),
63+
dict(type='PointSegClassMapping')
64+
],
65+
prob=1)
66+
],
67+
],
68+
prob=[0.5, 0.5]),
69+
dict(
70+
type='GlobalRotScaleTrans',
71+
rot_range=[0., 6.28318531],
72+
scale_ratio_range=[0.95, 1.05],
73+
translation_std=[0, 0, 0],
74+
),
75+
dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask'])
76+
]
77+
78+
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
79+
80+
default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=1))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_base_ = [
2+
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
3+
]
4+
5+
model = dict(
6+
data_preprocessor=dict(batch_first=True),
7+
backbone=dict(sparseconv_backend='minkowski'))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
_base_ = [
2+
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
3+
]
4+
5+
model = dict(
6+
data_preprocessor=dict(batch_first=True),
7+
backbone=dict(sparseconv_backend='spconv'))
8+
9+
optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')

0 commit comments

Comments
 (0)