def prepare_data(self, gt_annos, dt_annos, class_idx, difficulty_idx):
        """Wrapper function for cleaning data before computing metrics.
        """
        gt_list = []
        dt_list = []
        ignores_per_sample = []
        ignored_gts, ignored_dets, dontcares = [], [], []
        total_num_valid_gt = 0

        for gt_anno, dt_anno in zip(gt_annos, dt_annos):
            num_valid_gt, ignored_gt, ignored_det, ignored_bboxes = self.filter_data_fn(
                gt_anno, dt_anno, class_idx, difficulty_idx, self.id_to_name
            )
            ignored_gts.append(np.array(ignored_gt, dtype=np.int64))
            ignored_dets.append(np.array(ignored_det, dtype=np.int64))

            if len(ignored_bboxes) == 0:
                ignored_bboxes = np.zeros((0, 4)).astype(np.float64)
            else:
                ignored_bboxes = np.stack(ignored_bboxes, 0).astype(np.float64)

            ignores_per_sample.append(ignored_bboxes.shape[0])
            dontcares.append(ignored_bboxes)
            total_num_valid_gt += num_valid_gt
            gt_list.append(
                np.concatenate([
                    gt_anno["bbox"], gt_anno["rotation_y"][..., np.newaxis], gt_anno["alpha"][..., np.newaxis],
                    gt_anno["dimensions"]
                ], 1)
            )

            dt_list.append(
                np.concatenate([
                    dt_anno["bbox"], dt_anno["rotation_y"][..., np.newaxis], dt_anno["alpha"][..., np.newaxis],
                    dt_anno["dimensions"], dt_anno["score"][..., np.newaxis]
                ], 1)
            )

        ignores_per_sample = np.stack(ignores_per_sample, axis=0)
        return gt_list, dt_list, ignored_gts, ignored_dets, dontcares, ignores_per_sample, total_num_valid_gt
Wrapper function for cleaning data before computing metrics.
        
tridet/evaluators/kitti_3d_evaluator.py