Unverified Commit 58985341 authored by encore-zhou's avatar encore-zhou Committed by GitHub
Browse files

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

* add h3d backbone

* add h3d backbone

* add h3dnet

* modify scannet config

* fix bugs for proposal refine

* fix bugs for test backbone

* add primitive head test

* modify h3dhead

* modify h3d head

* update loss weight config

* fix bugs for h3d head loss

* modify h3d head get targets function

* update h3dnet base config

* modify weighted loss

* Revert "Merge branch 'h3d_u2' into 'master'"

This reverts merge request !5

* fix bugs for empty scene

* modify doc

* modify filter empty scene
parent 4308fb4e
...@@ -105,7 +105,7 @@ class Custom3DDataset(Dataset): ...@@ -105,7 +105,7 @@ class Custom3DDataset(Dataset):
if not self.test_mode: if not self.test_mode:
annos = self.get_ann_info(index) annos = self.get_ann_info(index)
input_dict['ann_info'] = annos 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():
return None return None
return input_dict return input_dict
...@@ -149,8 +149,9 @@ class Custom3DDataset(Dataset): ...@@ -149,8 +149,9 @@ class Custom3DDataset(Dataset):
return None return None
self.pre_pipeline(input_dict) self.pre_pipeline(input_dict)
example = self.pipeline(input_dict) example = self.pipeline(input_dict)
if self.filter_empty_gt and (example is None or len( if self.filter_empty_gt and \
example['gt_bboxes_3d']._data) == 0): (example is None or
~(example['gt_labels_3d']._data != -1).any()):
return None return None
return example return example
......
...@@ -335,6 +335,30 @@ class SSD3DHead(VoteHead): ...@@ -335,6 +335,30 @@ class SSD3DHead(VoteHead):
valid_gt = gt_labels_3d != -1 valid_gt = gt_labels_3d != -1
gt_bboxes_3d = gt_bboxes_3d[valid_gt] gt_bboxes_3d = gt_bboxes_3d[valid_gt]
gt_labels_3d = gt_labels_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(
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 gt_corner3d = gt_bboxes_3d.corners
(center_targets, size_targets, dir_class_targets, (center_targets, size_targets, dir_class_targets,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment