Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
5002b8e4
Commit
5002b8e4
authored
Oct 17, 2022
by
Qing Lian
Committed by
ZwwWayne
Dec 03, 2022
Browse files
update task name and config for fcos3d++ on nus (#1927)
parent
1071dab5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
13 deletions
+124
-13
configs/_base_/datasets/waymoD5-mono3d-3class.py
configs/_base_/datasets/waymoD5-mono3d-3class.py
+4
-4
configs/pgd/pgd_r101_fpn-head_dcn_16xb3_waymoD5-mono3d.py
configs/pgd/pgd_r101_fpn-head_dcn_16xb3_waymoD5-mono3d.py
+111
-0
mmdet3d/datasets/waymo_dataset.py
mmdet3d/datasets/waymo_dataset.py
+2
-2
mmdet3d/evaluation/metrics/waymo_metric.py
mmdet3d/evaluation/metrics/waymo_metric.py
+7
-7
No files found.
configs/_base_/datasets/waymoD5-mono3d-3class.py
View file @
5002b8e4
...
@@ -81,7 +81,7 @@ train_dataloader = dict(
...
@@ -81,7 +81,7 @@ train_dataloader = dict(
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
box_type_3d
=
'Camera'
,
box_type_3d
=
'Camera'
,
task
=
'mono
3d
'
,
task
=
'mono
_det
'
,
# load one frame every three frames
# load one frame every three frames
load_interval
=
5
))
load_interval
=
5
))
...
@@ -109,7 +109,7 @@ val_dataloader = dict(
...
@@ -109,7 +109,7 @@ val_dataloader = dict(
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
box_type_3d
=
'Camera'
,
box_type_3d
=
'Camera'
,
task
=
'mono
3d
'
,
task
=
'mono
_det
'
,
))
))
test_dataloader
=
dict
(
test_dataloader
=
dict
(
...
@@ -136,7 +136,7 @@ test_dataloader = dict(
...
@@ -136,7 +136,7 @@ test_dataloader = dict(
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
box_type_3d
=
'Camera'
,
box_type_3d
=
'Camera'
,
task
=
'mono
3d
'
,
task
=
'mono
_det
'
,
))
))
val_evaluator
=
dict
(
val_evaluator
=
dict
(
...
@@ -145,5 +145,5 @@ val_evaluator = dict(
...
@@ -145,5 +145,5 @@ val_evaluator = dict(
waymo_bin_file
=
'./data/waymo/waymo_format/cam_gt.bin'
,
waymo_bin_file
=
'./data/waymo/waymo_format/cam_gt.bin'
,
data_root
=
'./data/waymo/waymo_format'
,
data_root
=
'./data/waymo/waymo_format'
,
metric
=
'LET_mAP'
,
metric
=
'LET_mAP'
,
task
=
'mono
3d
'
)
task
=
'mono
_det
'
)
test_evaluator
=
val_evaluator
test_evaluator
=
val_evaluator
configs/pgd/pgd_r101_fpn-head_dcn_16xb3_waymoD5-mono3d.py
0 → 100644
View file @
5002b8e4
_base_
=
[
'../_base_/datasets/waymoD5-mono3d-3class.py'
,
'../_base_/models/pgd.py'
,
'../_base_/schedules/mmdet-schedule-1x.py'
,
'../_base_/default_runtime.py'
]
# model settings
model
=
dict
(
backbone
=
dict
(
type
=
'mmdet.ResNet'
,
depth
=
101
,
num_stages
=
4
,
out_indices
=
(
0
,
1
,
2
,
3
),
frozen_stages
=
1
,
norm_cfg
=
dict
(
type
=
'BN'
,
requires_grad
=
True
),
norm_eval
=
True
,
style
=
'pytorch'
,
init_cfg
=
dict
(
type
=
'Pretrained'
,
checkpoint
=
'torchvision://resnet101'
),
dcn
=
dict
(
type
=
'DCNv2'
,
deform_groups
=
1
,
fallback_on_stride
=
False
),
stage_with_dcn
=
(
False
,
False
,
True
,
True
)),
neck
=
dict
(
num_outs
=
3
),
bbox_head
=
dict
(
num_classes
=
3
,
bbox_code_size
=
7
,
pred_attrs
=
False
,
pred_velo
=
False
,
pred_bbox2d
=
True
,
use_onlyreg_proj
=
True
,
strides
=
(
8
,
16
,
32
),
regress_ranges
=
((
-
1
,
128
),
(
128
,
256
),
(
256
,
1e8
)),
group_reg_dims
=
(
2
,
1
,
3
,
1
,
16
,
4
),
# offset, depth, size, rot, kpts, bbox2d
reg_branch
=
(
(
256
,
),
# offset
(
256
,
),
# depth
(
256
,
),
# size
(
256
,
),
# rot
(
256
,
),
# kpts
(
256
,
)
# bbox2d
),
centerness_branch
=
(
256
,
),
loss_cls
=
dict
(
type
=
'mmdet.FocalLoss'
,
use_sigmoid
=
True
,
gamma
=
2.0
,
alpha
=
0.25
,
loss_weight
=
1.0
),
loss_bbox
=
dict
(
type
=
'mmdet.SmoothL1Loss'
,
beta
=
1.0
/
9.0
,
loss_weight
=
1.0
),
loss_dir
=
dict
(
type
=
'mmdet.CrossEntropyLoss'
,
use_sigmoid
=
False
,
loss_weight
=
1.0
),
loss_centerness
=
dict
(
type
=
'mmdet.CrossEntropyLoss'
,
use_sigmoid
=
True
,
loss_weight
=
1.0
),
use_depth_classifier
=
True
,
depth_branch
=
(
256
,
),
depth_range
=
(
0
,
50
),
depth_unit
=
10
,
division
=
'uniform'
,
depth_bins
=
6
,
pred_keypoints
=
True
,
weight_dim
=
1
,
loss_depth
=
dict
(
type
=
'UncertainSmoothL1Loss'
,
alpha
=
1.0
,
beta
=
3.0
,
loss_weight
=
1.0
),
loss_bbox2d
=
dict
(
type
=
'mmdet.SmoothL1Loss'
,
beta
=
1.0
/
9.0
,
loss_weight
=
0.0
),
loss_consistency
=
dict
(
type
=
'mmdet.GIoULoss'
,
loss_weight
=
0.0
),
bbox_coder
=
dict
(
type
=
'PGDBBoxCoder'
,
base_depths
=
((
41.01
,
18.44
),
),
base_dims
=
(
(
4.73
,
1.77
,
2.08
),
(
0.91
,
1.74
,
0.84
),
(
1.81
,
1.77
,
0.84
),
),
code_size
=
7
)),
# set weight 1.0 for base 7 dims (offset, depth, size, rot)
# 0.2 for 16-dim keypoint offsets and 1.0 for 4-dim 2D distance targets
train_cfg
=
dict
(
code_weight
=
[
1.0
,
1.0
,
0.2
,
1.0
,
1.0
,
1.0
,
1.0
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
0.2
,
1.0
,
1.0
,
1.0
,
1.0
]),
test_cfg
=
dict
(
nms_pre
=
100
,
nms_thr
=
0.05
,
score_thr
=
0.001
,
max_per_img
=
20
))
# optimizer
optim_wrapper
=
dict
(
optimizer
=
dict
(
type
=
'SGD'
,
lr
=
0.008
,
),
paramwise_cfg
=
dict
(
bias_lr_mult
=
2.
,
bias_decay_mult
=
0.
),
clip_grad
=
dict
(
max_norm
=
35
,
norm_type
=
2
))
param_scheduler
=
[
dict
(
type
=
'LinearLR'
,
start_factor
=
1.0
/
3
,
by_epoch
=
False
,
begin
=
0
,
end
=
500
),
dict
(
type
=
'MultiStepLR'
,
begin
=
0
,
end
=
24
,
by_epoch
=
True
,
milestones
=
[
16
,
22
],
gamma
=
0.1
)
]
total_epochs
=
24
runner
=
dict
(
max_epochs
=
total_epochs
)
train_cfg
=
dict
(
type
=
'EpochBasedTrainLoop'
,
max_epochs
=
24
,
val_interval
=
24
)
val_cfg
=
dict
(
type
=
'ValLoop'
)
test_cfg
=
dict
(
type
=
'TestLoop'
)
mmdet3d/datasets/waymo_dataset.py
View file @
5002b8e4
...
@@ -93,7 +93,6 @@ class WaymoDataset(KittiDataset):
...
@@ -93,7 +93,6 @@ class WaymoDataset(KittiDataset):
self
.
cat_ids
=
range
(
len
(
self
.
METAINFO
[
'CLASSES'
]))
self
.
cat_ids
=
range
(
len
(
self
.
METAINFO
[
'CLASSES'
]))
self
.
cat2label
=
{
cat_id
:
i
for
i
,
cat_id
in
enumerate
(
self
.
cat_ids
)}
self
.
cat2label
=
{
cat_id
:
i
for
i
,
cat_id
in
enumerate
(
self
.
cat_ids
)}
self
.
max_sweeps
=
max_sweeps
self
.
max_sweeps
=
max_sweeps
self
.
task
=
task
# we do not provide file_client_args to custom_3d init
# we do not provide file_client_args to custom_3d init
# because we want disk loading for info
# because we want disk loading for info
# while ceph loading for KITTI2Waymo
# while ceph loading for KITTI2Waymo
...
@@ -108,6 +107,7 @@ class WaymoDataset(KittiDataset):
...
@@ -108,6 +107,7 @@ class WaymoDataset(KittiDataset):
default_cam_key
=
default_cam_key
,
default_cam_key
=
default_cam_key
,
data_prefix
=
data_prefix
,
data_prefix
=
data_prefix
,
test_mode
=
test_mode
,
test_mode
=
test_mode
,
task
=
task
,
**
kwargs
)
**
kwargs
)
def
parse_ann_info
(
self
,
info
:
dict
)
->
dict
:
def
parse_ann_info
(
self
,
info
:
dict
)
->
dict
:
...
@@ -221,7 +221,7 @@ class WaymoDataset(KittiDataset):
...
@@ -221,7 +221,7 @@ class WaymoDataset(KittiDataset):
# TODO check if need to modify the sample id
# TODO check if need to modify the sample id
# TODO check when will use it except for evaluation.
# TODO check when will use it except for evaluation.
camera_info
[
'sample_id
x
'
]
=
info
[
'sample_id
x
'
]
camera_info
[
'sample_id'
]
=
info
[
'sample_id'
]
if
not
self
.
test_mode
:
if
not
self
.
test_mode
:
# used in training
# used in training
...
...
mmdet3d/evaluation/metrics/waymo_metric.py
View file @
5002b8e4
...
@@ -67,7 +67,7 @@ class WaymoMetric(KittiMetric):
...
@@ -67,7 +67,7 @@ class WaymoMetric(KittiMetric):
prefix
:
Optional
[
str
]
=
None
,
prefix
:
Optional
[
str
]
=
None
,
pklfile_prefix
:
str
=
None
,
pklfile_prefix
:
str
=
None
,
submission_prefix
:
str
=
None
,
submission_prefix
:
str
=
None
,
task
=
'lidar'
,
task
=
'lidar
_det
'
,
default_cam_key
:
str
=
'CAM_FRONT'
,
default_cam_key
:
str
=
'CAM_FRONT'
,
use_pred_sample_idx
:
bool
=
False
,
use_pred_sample_idx
:
bool
=
False
,
collect_device
:
str
=
'cpu'
,
collect_device
:
str
=
'cpu'
,
...
@@ -106,7 +106,7 @@ class WaymoMetric(KittiMetric):
...
@@ -106,7 +106,7 @@ class WaymoMetric(KittiMetric):
self
.
data_infos
=
load
(
self
.
ann_file
)[
'data_list'
]
self
.
data_infos
=
load
(
self
.
ann_file
)[
'data_list'
]
# different from kitti, waymo do not need to convert the ann file
# different from kitti, waymo do not need to convert the ann file
# handle the mono3d task
# handle the mono3d task
if
self
.
task
==
'mono
3d
'
:
if
self
.
task
==
'mono
_det
'
:
new_data_infos
=
[]
new_data_infos
=
[]
for
info
in
self
.
data_infos
:
for
info
in
self
.
data_infos
:
height
=
info
[
'images'
][
self
.
default_cam_key
][
'height'
]
height
=
info
[
'images'
][
self
.
default_cam_key
][
'height'
]
...
@@ -461,7 +461,7 @@ class WaymoMetric(KittiMetric):
...
@@ -461,7 +461,7 @@ class WaymoMetric(KittiMetric):
# If you want to use another camera, please modify it.
# If you want to use another camera, please modify it.
image_shape
=
(
info
[
'images'
][
self
.
default_cam_key
][
'height'
],
image_shape
=
(
info
[
'images'
][
self
.
default_cam_key
][
'height'
],
info
[
'images'
][
self
.
default_cam_key
][
'width'
])
info
[
'images'
][
self
.
default_cam_key
][
'width'
])
if
self
.
task
==
'mono
3d
'
:
if
self
.
task
==
'mono
_det
'
:
box_dict_per_frame
.
append
(
box_dict
)
box_dict_per_frame
.
append
(
box_dict
)
if
(
idx
+
1
)
%
self
.
num_cams
!=
0
:
if
(
idx
+
1
)
%
self
.
num_cams
!=
0
:
continue
continue
...
@@ -600,9 +600,9 @@ class WaymoMetric(KittiMetric):
...
@@ -600,9 +600,9 @@ class WaymoMetric(KittiMetric):
sample_idx
=
sample_idx
)
sample_idx
=
sample_idx
)
# Here default used 'CAM2' to compute metric. If you want to
# Here default used 'CAM2' to compute metric. If you want to
# use another camera, please modify it.
# use another camera, please modify it.
if
self
.
task
in
[
'mv3d'
,
'lidar'
]:
if
self
.
task
in
[
'mv3d
_det
'
,
'lidar
_det
'
]:
cam_key
=
self
.
default_cam_key
cam_key
=
self
.
default_cam_key
elif
self
.
task
==
'mono
3d
'
:
elif
self
.
task
==
'mono
_det
'
:
cam_key
=
list
(
info
[
'images'
].
keys
())[
0
]
cam_key
=
list
(
info
[
'images'
].
keys
())[
0
]
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
...
@@ -635,12 +635,12 @@ class WaymoMetric(KittiMetric):
...
@@ -635,12 +635,12 @@ class WaymoMetric(KittiMetric):
(
box_2d_preds
[:,
1
]
<
image_shape
[
0
])
&
(
box_2d_preds
[:,
1
]
<
image_shape
[
0
])
&
(
box_2d_preds
[:,
2
]
>
0
)
&
(
box_2d_preds
[:,
3
]
>
0
))
(
box_2d_preds
[:,
2
]
>
0
)
&
(
box_2d_preds
[:,
3
]
>
0
))
# check box_preds_lidar
# check box_preds_lidar
if
self
.
task
in
[
'
lidar'
,
'mono3d
'
]:
if
self
.
task
in
[
'
mv3d_det'
,
'lidar_det
'
]:
limit_range
=
box_preds
.
tensor
.
new_tensor
(
self
.
pcd_limit_range
)
limit_range
=
box_preds
.
tensor
.
new_tensor
(
self
.
pcd_limit_range
)
valid_pcd_inds
=
((
box_preds_lidar
.
center
>
limit_range
[:
3
])
&
valid_pcd_inds
=
((
box_preds_lidar
.
center
>
limit_range
[:
3
])
&
(
box_preds_lidar
.
center
<
limit_range
[
3
:]))
(
box_preds_lidar
.
center
<
limit_range
[
3
:]))
valid_inds
=
valid_pcd_inds
.
all
(
-
1
)
valid_inds
=
valid_pcd_inds
.
all
(
-
1
)
elif
self
.
task
==
'mono
3d
'
:
elif
self
.
task
==
'mono
_det
'
:
valid_inds
=
valid_cam_inds
valid_inds
=
valid_cam_inds
if
valid_inds
.
sum
()
>
0
:
if
valid_inds
.
sum
()
>
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment