Skip to content

A small bug in concat_batcher.py #673

Description

@daobilige-su

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions