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

[Fix] fix bugs for 3DSSD triggered by empty GT #258

Merged
merged 33 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c3eb438
add h3d backbone
encore-zhou Jul 30, 2020
7bad06a
add h3d backbone
encore-zhou Jul 31, 2020
c000678
add h3dnet
encore-zhou Aug 4, 2020
d95f2c3
modify scannet config
encore-zhou Aug 4, 2020
8b63a37
fix bugs for proposal refine
encore-zhou Aug 5, 2020
2b3da09
fix bugs for test backbone
encore-zhou Aug 5, 2020
b87966b
add primitive head test
encore-zhou Aug 5, 2020
22cbe1c
modify h3dhead
encore-zhou Aug 5, 2020
0aa7127
modify h3d head
encore-zhou Aug 6, 2020
60a8c50
update loss weight config
encore-zhou Aug 6, 2020
7f6b7c0
fix bugs for h3d head loss
encore-zhou Aug 6, 2020
1eb18fd
modify h3d head get targets function
encore-zhou Aug 7, 2020
486b174
update h3dnet base config
encore-zhou Aug 7, 2020
09ba55f
modify weighted loss
encore-zhou Aug 7, 2020
d36f2ae
Merge branch 'h3d_u2' into 'master'
encore-zhou Aug 7, 2020
fb65d0e
Revert "Merge branch 'h3d_u2' into 'master'"
encore-zhou Aug 7, 2020
87fdac2
Merge branch 'revert-d36f2ae9' into 'master'
encore-zhou Aug 10, 2020
d28ba29
Merge pull request #1 from open-mmlab/master
encore-zhou Aug 31, 2020
dce3b11
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 3, 2020
65d7ed8
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 10, 2020
221a9b9
Merge branch 'master' of gitlab.bj.sensetime.com:zhoujiaming/mmdet3d
encore-zhou Sep 10, 2020
0ea70a3
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 11, 2020
1f76b7d
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 13, 2020
c1a776e
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 14, 2020
1da0983
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 14, 2020
c5a4688
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Sep 22, 2020
61116c8
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Oct 9, 2020
0271ca0
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Nov 2, 2020
13251c8
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Nov 17, 2020
716742a
Merge branch 'master' of github.com:open-mmlab/mmdetection3d
encore-zhou Jan 6, 2021
d5f0ab2
fix bugs for empty scene
encore-zhou Jan 6, 2021
3f30cb6
modify doc
encore-zhou Jan 6, 2021
a667cbf
modify filter empty scene
encore-zhou Jan 6, 2021
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
7 changes: 4 additions & 3 deletions mmdet3d/datasets/custom_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_data_info(self, index):
if not self.test_mode:
annos = self.get_ann_info(index)
input_dict['ann_info'] = annos
if self.filter_empty_gt and len(annos['gt_bboxes_3d']) == 0:
if self.filter_empty_gt and ~(annos['gt_labels_3d'] != -1).any():
ZwwWayne marked this conversation as resolved.
Show resolved Hide resolved
return None
return input_dict

Expand Down Expand Up @@ -149,8 +149,9 @@ def prepare_train_data(self, index):
return None
self.pre_pipeline(input_dict)
example = self.pipeline(input_dict)
if self.filter_empty_gt and (example is None or len(
example['gt_bboxes_3d']._data) == 0):
if self.filter_empty_gt and \
(example is None or
~(example['gt_labels_3d']._data != -1).any()):
return None
return example

Expand Down
24 changes: 24 additions & 0 deletions mmdet3d/models/dense_heads/ssd_3d_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,30 @@ def get_targets_single(self,
valid_gt = gt_labels_3d != -1
gt_bboxes_3d = gt_bboxes_3d[valid_gt]
gt_labels_3d = gt_labels_3d[valid_gt]

# Generate fake GT for empty scene
if valid_gt.sum() == 0:
vote_targets = points.new_zeros(self.num_candidates, 3)
center_targets = points.new_zeros(self.num_candidates, 3)
size_res_targets = points.new_zeros(self.num_candidates, 3)
dir_class_targets = points.new_zeros(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May add unit test for the case of empty GT.

self.num_candidates, dtype=torch.int64)
dir_res_targets = points.new_zeros(self.num_candidates)
mask_targets = points.new_zeros(
self.num_candidates, dtype=torch.int64)
centerness_targets = points.new_zeros(self.num_candidates,
self.num_classes)
corner3d_targets = points.new_zeros(self.num_candidates, 8, 3)
vote_mask = points.new_zeros(self.num_candidates, dtype=torch.bool)
positive_mask = points.new_zeros(
self.num_candidates, dtype=torch.bool)
negative_mask = points.new_ones(
self.num_candidates, dtype=torch.bool)
return (vote_targets, center_targets, size_res_targets,
dir_class_targets, dir_res_targets, mask_targets,
centerness_targets, corner3d_targets, vote_mask,
positive_mask, negative_mask)

gt_corner3d = gt_bboxes_3d.corners

(center_targets, size_targets, dir_class_targets,
Expand Down