Open3D-ML icon indicating copy to clipboard operation
Open3D-ML copied to clipboard

A small bug in concat_batcher.py

Open daobilige-su opened this issue 10 months ago • 0 comments

In the concat_batcher.py file, in the implementation of the class ObjectDetectBatch,

class ObjectDetectBatch:
    def __init__(self, batches):
        """Initialize.

        Args:
            batches: A batch of data

        Returns:
            class: The corresponding class.
        """
        self.point = []
        self.labels = []
        self.bboxes = []
        self.bbox_objs = []
        self.calib = []
        self.attr = []

        for batch in batches:
            data = batch['data']
            self.point.append(torch.tensor(data['point'], dtype=torch.float32))
            self.labels.append(
                torch.tensor(data['labels'], dtype=torch.int64) if 'labels' in
                data else None)
            if len(data.get('bboxes', [])) > 0:
                self.bboxes.append(
                    torch.tensor(data['bboxes'], dtype=torch.float32
                                ) if 'bboxes' in data else None)
            else:
                self.bboxes.append(torch.zeros((0, 7)))
            self.bbox_objs.append(data.get('bbox_objs'))
            self.calib.append(data.get('calib'))

shouldn't we add a line self.attr.append(batch['attr']) in the end of the __init__ function? Otherwise the 'attr' field is missing, and it causes save_test_result() function in kitti.py not saving anything.

daobilige-su avatar Mar 28 '25 18:03 daobilige-su