Based on the dataloading for KITTI dataset, I've noticed that gt_labels_3d contains -1 values for classes that are not currently trained.
|
gt_labels = [] |
|
for cat in gt_names: |
|
if cat in self.CLASSES: |
|
gt_labels.append(self.CLASSES.index(cat)) |
|
else: |
|
gt_labels.append(-1) |
|
gt_labels = np.array(gt_labels).astype(np.int64) |
|
gt_labels_3d = copy.deepcopy(gt_labels) |
|
|
|
anns_results = dict( |
|
gt_bboxes_3d=gt_bboxes_3d, |
|
gt_labels_3d=gt_labels_3d, |
|
bboxes=gt_bboxes, |
|
labels=gt_labels, |
|
gt_names=gt_names) |
|
return anns_results |
Looking at
#764, I see that for
ssd_3d_head.py this is addressed before targets are set. However, for
anchor3d_head.py, it seems like this is dealt with at the very end, after all the anchor matching is done (dealt with by the fact that focal loss treats "-1" target as background & a non-negative mask is used before regression loss computation).
I was wondering if allowing these irrelevant classes to even match to anchors at all potentially interferes with matching of the relevant classes - why not just completely filter them away at the data loading stage? Such a patch is necessary anyway when directly using the kitti_dataset.py to train a 2D model.
Also, on a related note, is this part necessary?
|
selected = self.drop_arrays_by_name(gt_names, ['DontCare']) |
|
gt_bboxes = gt_bboxes[selected].astype('float32') |
|
gt_names = gt_names[selected] |
I thought this line already takes care of DontCare
|
annos = self.remove_dontcare(annos) |
Based on the dataloading for KITTI dataset, I've noticed that gt_labels_3d contains -1 values for classes that are not currently trained.
mmdetection3d/mmdet3d/datasets/kitti_dataset.py
Lines 178 to 193 in a876a47
Looking at #764, I see that for
ssd_3d_head.pythis is addressed before targets are set. However, foranchor3d_head.py, it seems like this is dealt with at the very end, after all the anchor matching is done (dealt with by the fact that focal loss treats "-1" target as background & a non-negative mask is used before regression loss computation).I was wondering if allowing these irrelevant classes to even match to anchors at all potentially interferes with matching of the relevant classes - why not just completely filter them away at the data loading stage? Such a patch is necessary anyway when directly using the kitti_dataset.py to train a 2D model.
Also, on a related note, is this part necessary?
mmdetection3d/mmdet3d/datasets/kitti_dataset.py
Lines 174 to 176 in a876a47
I thought this line already takes care of DontCare
mmdetection3d/mmdet3d/datasets/kitti_dataset.py
Line 161 in a876a47