Skip to content

Commit 7d5c5a3

Browse files
authored
[Fix] fix some mono3d related bugs (#1816)
* fix mono3d related bugs * update kitti-mono3d script * update mono3d task * update resize3d and randomresize3d * fix * update dataset converter script * fix part of comments * unify the task name in datasets and visualization * fix comments * rename 3d to lidar_det * fix ci * change boxlist to boxtype * change default value ot lidar_det * fix bugs
1 parent 4b73569 commit 7d5c5a3

20 files changed

+241
-188
lines changed

configs/_base_/datasets/kitti-mono3d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
dict(type='Resize', scale=(1242, 375), keep_ratio=True),
3636
dict(type='Pack3DDetInputs', keys=['img'])
3737
]
38+
eval_pipeline = [
39+
dict(type='LoadImageFromFileMono3D'),
40+
dict(type='Pack3DDetInputs', keys=['img'])
41+
]
3842

3943
train_dataloader = dict(
4044
batch_size=2,

configs/_base_/datasets/nus-mono3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
CAM_BACK_RIGHT='samples/CAM_BACK_RIGHT',
6666
CAM_BACK_LEFT='samples/CAM_BACK_LEFT'),
6767
ann_file='nuscenes_infos_train.pkl',
68-
task='mono3d',
68+
task='mono_det',
6969
pipeline=train_pipeline,
7070
metainfo=metainfo,
7171
modality=input_modality,
@@ -92,7 +92,7 @@
9292
CAM_BACK_RIGHT='samples/CAM_BACK_RIGHT',
9393
CAM_BACK_LEFT='samples/CAM_BACK_LEFT'),
9494
ann_file='nuscenes_infos_val.pkl',
95-
task='mono3d',
95+
task='mono_det',
9696
pipeline=test_pipeline,
9797
modality=input_modality,
9898
metainfo=metainfo,

configs/pgd/pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
# optimizer
115115
optim_wrapper = dict(
116-
optimizer=dict(lr=0.01),
116+
optimizer=dict(lr=0.001),
117117
paramwise_cfg=dict(bias_lr_mult=2., bias_decay_mult=0.),
118118
clip_grad=dict(max_norm=35, norm_type=2))
119119

@@ -134,4 +134,4 @@
134134
gamma=0.1)
135135
]
136136

137-
train_cfg = dict(max_epochs=48)
137+
train_cfg = dict(max_epochs=48, val_interval=2)

configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@
4747
test_dataloader = dict(dataset=dict(pipeline=test_pipeline))
4848
val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
4949

50-
# training schedule for 1x
51-
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=12, val_interval=1)
50+
# training schedule for 6x
51+
max_epochs = 72
52+
train_cfg = dict(
53+
type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=5)
5254
val_cfg = dict(type='ValLoop')
5355
test_cfg = dict(type='TestLoop')
5456

@@ -57,9 +59,9 @@
5759
dict(
5860
type='MultiStepLR',
5961
begin=0,
60-
end=12,
62+
end=max_epochs,
6163
by_epoch=True,
62-
milestones=[8, 11],
64+
milestones=[50],
6365
gamma=0.1)
6466
]
6567

@@ -68,3 +70,5 @@
6870
type='OptimWrapper',
6971
optimizer=dict(type='Adam', lr=2.5e-4),
7072
clip_grad=None)
73+
74+
find_unused_parameters = True

demo/mono_det_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def main(args):
6666
wait_time=0,
6767
out_file=args.out_dir,
6868
pred_score_thr=args.score_thr,
69-
vis_task='mono-det')
69+
vis_task='mono_det')
7070

7171

7272
if __name__ == '__main__':

demo/multi_modality_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def main(args):
6767
wait_time=0,
6868
out_file=args.out_dir,
6969
pred_score_thr=args.score_thr,
70-
vis_task='multi_modality-det')
70+
vis_task='multi-modality_det')
7171

7272

7373
if __name__ == '__main__':

demo/pcd_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def main(args):
5656
wait_time=0,
5757
out_file=args.out_dir,
5858
pred_score_thr=args.score_thr,
59-
vis_task='det')
59+
vis_task='lidar_det')
6060

6161

6262
if __name__ == '__main__':

demo/pcd_seg_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def main(args):
5151
show=True,
5252
wait_time=0,
5353
out_file=args.out_dir,
54-
vis_task='seg')
54+
vis_task='lidar_seg')
5555

5656

5757
if __name__ == '__main__':

docs/zh_cn/user_guides/useful_tools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ python tools/misc/browse_dataset.py configs/_base_/datasets/kitti-3d-3class.py -
102102
python tools/misc/browse_dataset.py configs/_base_/datasets/kitti-3d-3class.py --task det --aug --output-dir ${OUTPUT_DIR} --online
103103
```
104104

105-
如果您还想显示 2D 图像以及投影的 3D 边界框,则需要找到支持多模态数据加载的配置文件,然后将 `--task` 参数更改为 `multi_modality-det`。一个例子如下所示
105+
如果您还想显示 2D 图像以及投影的 3D 边界框,则需要找到支持多模态数据加载的配置文件,然后将 `--task` 参数更改为 `multi-modality_det`。一个例子如下所示
106106

107107
```shell
108-
python tools/misc/browse_dataset.py configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py --task multi_modality-det --output-dir ${OUTPUT_DIR} --online
108+
python tools/misc/browse_dataset.py configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py --task multi-modality_det --output-dir ${OUTPUT_DIR} --online
109109
```
110110

111111
![](../../resources/browse_dataset_multi_modality.png)
@@ -121,7 +121,7 @@ python tools/misc/browse_dataset.py configs/_base_/datasets/scannet-seg.py --tas
121121
在单目 3D 检测任务中浏览 nuScenes 数据集
122122

123123
```shell
124-
python tools/misc/browse_dataset.py configs/_base_/datasets/nus-mono3d.py --task mono-det --output-dir ${OUTPUT_DIR} --online
124+
python tools/misc/browse_dataset.py configs/_base_/datasets/nus-mono3d.py --task mono_det --output-dir ${OUTPUT_DIR} --online
125125
```
126126

127127
![](../../resources/browse_dataset_mono.png)

mmdet3d/datasets/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
from .builder import DATASETS, PIPELINES, build_dataset
3-
from .convert_utils import get_2d_boxes
43
from .dataset_wrappers import CBGSDataset
54
from .det3d_dataset import Det3DDataset
65
from .kitti_dataset import KittiDataset
@@ -22,8 +21,8 @@
2221
ObjectNameFilter, ObjectNoise, ObjectRangeFilter,
2322
ObjectSample, PointSample, PointShuffle,
2423
PointsRangeFilter, RandomDropPointsColor,
25-
RandomFlip3D, RandomJitterPoints, RandomShiftScale,
26-
VoxelBasedPointSampler)
24+
RandomFlip3D, RandomJitterPoints, RandomResize3D,
25+
RandomShiftScale, Resize3D, VoxelBasedPointSampler)
2726
from .utils import get_loading_pipeline
2827
from .waymo_dataset import WaymoDataset
2928

@@ -40,5 +39,6 @@
4039
'LoadPointsFromMultiSweeps', 'WaymoDataset', 'BackgroundPointsFilter',
4140
'VoxelBasedPointSampler', 'get_loading_pipeline', 'RandomDropPointsColor',
4241
'RandomJitterPoints', 'ObjectNameFilter', 'AffineResize',
43-
'RandomShiftScale', 'LoadPointsFromDict', 'PIPELINES', 'get_2d_boxes'
42+
'RandomShiftScale', 'LoadPointsFromDict', 'PIPELINES',
43+
'Resize3D', 'RandomResize3D',
4444
]

0 commit comments

Comments
 (0)