Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]Add Lidarseg benchmark #2530

Merged
merged 29 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8e945c6
enhance minkunet
sunjiahao1999 Apr 18, 2023
29e7bae
add 2x
sunjiahao1999 Apr 18, 2023
5cc5130
add config
sunjiahao1999 Apr 19, 2023
66be239
add flip...
sunjiahao1999 Apr 21, 2023
49b220f
add bottleneck
sunjiahao1999 Apr 24, 2023
a6c79f1
Merge remote-tracking branch 'origin/lidarseg_mink' into lidarseg_mink
sunjiahao1999 Apr 24, 2023
2ae6b88
add spvcnn & cylinder3d
sunjiahao1999 Apr 25, 2023
f2aec44
merge dev-1.x
sunjiahao1999 Apr 25, 2023
daa0522
add spvcnn & cylinder3d
sunjiahao1999 Apr 26, 2023
af3e0b0
merge origin/lidarseg
sunjiahao1999 Apr 26, 2023
d7dd042
refactor minkunet & spvcnn
sunjiahao1999 Apr 27, 2023
aa6e1d6
add minkv2
sunjiahao1999 May 6, 2023
74b5df1
Merge branch 'lidarseg_mink' of github.com:sunjiahao1999/mmdetection3…
sunjiahao1999 May 6, 2023
b8bf5be
merge dev-1.x
sunjiahao1999 May 6, 2023
8fcab8a
fix mink34 shared res block
sunjiahao1999 May 8, 2023
df3b94a
add mink spconv
sunjiahao1999 May 9, 2023
5278b1d
fix spconv int32 max bug
sunjiahao1999 May 10, 2023
b48ec71
fix spconv int32 max bug2
sunjiahao1999 May 10, 2023
521820f
add minkowski backends
sunjiahao1999 May 14, 2023
648cc67
rename config
sunjiahao1999 May 15, 2023
450b278
fix minkv2 config
sunjiahao1999 May 15, 2023
21af595
fix max voxel bug
sunjiahao1999 May 15, 2023
7299cdd
add checkpointhook mink18
sunjiahao1999 May 15, 2023
43b3a9d
add backbone docstring
sunjiahao1999 May 15, 2023
7c92c20
fix torchsparse uninstall bug
sunjiahao1999 May 16, 2023
233d3cc
remove ME
sunjiahao1999 May 16, 2023
dedd66f
resolve conflicts
sunjiahao1999 May 19, 2023
ea7a367
fix ut
sunjiahao1999 May 19, 2023
1b1ebfe
fix cylinder3d config
sunjiahao1999 May 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions configs/_base_/models/minkunet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@
type='Det3DDataPreprocessor',
voxel=True,
voxel_type='minkunet',
batch_first=False,
max_voxels=80000,
voxel_layer=dict(
max_num_points=-1,
point_cloud_range=[-100, -100, -20, 100, 100, 20],
voxel_size=[0.05, 0.05, 0.05],
max_voxels=(-1, -1)),
max_voxels=80000),
max_voxels=(-1, -1))),
backbone=dict(
type='MinkUNetBackbone',
in_channels=4,
base_channels=32,
num_stages=4,
base_channels=32,
encoder_channels=[32, 64, 128, 256],
decoder_channels=[256, 128, 96, 96]),
encoder_blocks=[2, 2, 2, 2],
decoder_channels=[256, 128, 96, 96],
decoder_blocks=[2, 2, 2, 2],
block_type='basic',
sparseconv_backend='torchsparse'),
decode_head=dict(
type='MinkUNetHead',
channels=96,
Expand Down
11 changes: 8 additions & 3 deletions configs/_base_/models/spvcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@
type='Det3DDataPreprocessor',
voxel=True,
voxel_type='minkunet',
batch_first=False,
max_voxels=80000,
voxel_layer=dict(
max_num_points=-1,
point_cloud_range=[-100, -100, -20, 100, 100, 20],
voxel_size=[0.05, 0.05, 0.05],
max_voxels=(-1, -1)),
max_voxels=80000),
max_voxels=(-1, -1))),
backbone=dict(
type='SPVCNNBackbone',
in_channels=4,
base_channels=32,
num_stages=4,
base_channels=32,
encoder_channels=[32, 64, 128, 256],
encoder_blocks=[2, 2, 2, 2],
decoder_channels=[256, 128, 96, 96],
decoder_blocks=[2, 2, 2, 2],
block_type='basic',
sparseconv_backend='torchsparse',
drop_ratio=0.3),
decode_head=dict(
type='MinkUNetHead',
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/schedules/schedule-3x.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
clip_grad=dict(max_norm=10, norm_type=2),
)

# training schedule for 1x
# training schedule for 3x
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=36, val_interval=1)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
]

# optimizer
# This schedule is mainly used by models on nuScenes dataset
lr = 0.001
optim_wrapper = dict(
type='OptimWrapper',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
_base_ = [
'../_base_/datasets/semantickitti.py', '../_base_/models/cylinder3d.py',
'../_base_/schedules/schedule-3x.py', '../_base_/default_runtime.py'
]

train_pipeline = [
dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping'),
dict(
type='RandomChoice',
transforms=[
[
dict(
type='LaserMix',
num_areas=[3, 4, 5, 6],
pitch_angles=[-25, 3],
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
[
dict(
type='PolarMix',
instance_classes=[0, 1, 2, 3, 4, 5, 6, 7],
swap_ratio=0.5,
rotate_paste_ratio=1.0,
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
],
prob=[0.5, 0.5]),
dict(
type='GlobalRotScaleTrans',
rot_range=[0., 6.28318531],
scale_ratio_range=[0.95, 1.05],
translation_std=[0, 0, 0],
),
dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask'])
]

train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=1))
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_base_ = [
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
]

model = dict(
data_preprocessor=dict(batch_first=True),
backbone=dict(sparseconv_backend='minkowski'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_base_ = [
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
]

model = dict(
data_preprocessor=dict(batch_first=True),
backbone=dict(sparseconv_backend='spconv'))

optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_base_ = [
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
]

model = dict(
data_preprocessor=dict(batch_first=True),
backbone=dict(sparseconv_backend='spconv'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_base_ = [
'./minkunet34_w32_torchsparse_8xb2-laser-polar-mix-3x_semantickitti.py'
]

optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
_base_ = [
'../_base_/datasets/semantickitti.py', '../_base_/models/minkunet.py',
'../_base_/schedules/schedule-3x.py', '../_base_/default_runtime.py'
]

model = dict(
data_preprocessor=dict(max_voxels=None),
backbone=dict(encoder_blocks=[2, 3, 4, 6]))

train_pipeline = [
dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping'),
dict(
type='RandomChoice',
transforms=[
[
dict(
type='LaserMix',
num_areas=[3, 4, 5, 6],
pitch_angles=[-25, 3],
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
[
dict(
type='PolarMix',
instance_classes=[0, 1, 2, 3, 4, 5, 6, 7],
swap_ratio=0.5,
rotate_paste_ratio=1.0,
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
],
prob=[0.5, 0.5]),
dict(
type='GlobalRotScaleTrans',
rot_range=[0., 6.28318531],
scale_ratio_range=[0.95, 1.05],
translation_std=[0, 0, 0],
),
dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask'])
]

train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=1))
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_base_ = [
'./minkunet34_w32_torchsparse_8xb2-amp-laser-polar-mix-3x_semantickitti.py'
]

model = dict(
backbone=dict(type='MinkUNetBackboneV2'),
decode_head=dict(channels=256 + 128 + 96))

randomness = dict(seed=None, deterministic=False, diff_rank_seed=True)
env_cfg = dict(cudnn_benchmark=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
_base_ = [
'../_base_/datasets/semantickitti.py', '../_base_/models/spvcnn.py',
'../_base_/schedules/schedule-3x.py', '../_base_/default_runtime.py'
]

model = dict(data_preprocessor=dict(max_voxels=None))

train_pipeline = [
dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping'),
dict(
type='RandomChoice',
transforms=[
[
dict(
type='LaserMix',
num_areas=[3, 4, 5, 6],
pitch_angles=[-25, 3],
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
[
dict(
type='PolarMix',
instance_classes=[0, 1, 2, 3, 4, 5, 6, 7],
swap_ratio=0.5,
rotate_paste_ratio=1.0,
pre_transform=[
dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=4),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_seg_3d=True,
seg_3d_dtype='np.int32',
seg_offset=2**16,
dataset_type='semantickitti'),
dict(type='PointSegClassMapping')
],
prob=1)
],
],
prob=[0.5, 0.5]),
dict(
type='GlobalRotScaleTrans',
rot_range=[0., 6.28318531],
scale_ratio_range=[0.95, 1.05],
translation_std=[0, 0, 0],
),
dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask'])
]

train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')

default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=1))
randomness = dict(seed=0, deterministic=False, diff_rank_seed=True)
env_cfg = dict(cudnn_benchmark=True)
Loading