def visualize(self, x):
        """

        Parameters
        ----------
        x: Dict
            One 'dataset_dict'.

        Returns
        -------
        viz_images: Dict[np.array]
            Visualizations as RGB images.
        """
        # Load image.
        img = d2_utils.read_image(x["file_name"], format=self._input_format)
        img = d2_utils.convert_image_to_rgb(img, self._input_format)

        viz_images = OrderedDict()

        # GT 3D boxes
        gt_boxes3d = [np.float32(ann['bbox3d']) for ann in x['annotations']]
        gt_class_ids = [ann['category_id'] for ann in x['annotations']]
        viz_image = draw_boxes3d_cam(
            img.copy(),
            gt_boxes3d,
            gt_class_ids,
            self._metadata,
            x['intrinsics'],
            scores=None,
            render_labels=self._render_labels
        )
        viz_images['viz_gt_boxes3d_cam'] = viz_image

        # Predicted 3D boxes.
        pred_instances = self.pred_instances_by_image[x['image_id']]
        pred_boxes3d = pred_instances.pred_boxes3d
        if self._min_depth_center > 0.:
            pred_boxes3d = pred_boxes3d[pred_boxes3d[:, 6] > self._min_depth_center]

        pred_class_ids = pred_instances.pred_classes
        scores = pred_instances.scores
        viz_image = draw_boxes3d_cam(
            img.copy(),
            pred_boxes3d,
            pred_class_ids,
            self._metadata,
            x['intrinsics'],
            scores=scores,
            render_labels=self._render_labels
        )
        viz_images['viz_pred_boxes3d_cam'] = viz_image

        # GT + Pred 3D boxes on BEV.
        viz_image, bev_obj = draw_boxes3d_bev(
            GenericBoxes3D.from_vectors(gt_boxes3d),
            intrinsics=x['intrinsics'],
            extrinsics=x['extrinsics'],
            class_ids=gt_class_ids,
            image_width=img.shape[1],
            metadata=None,
            color=(0, 255, 0)
        )
        viz_image, bev_obj = draw_boxes3d_bev(
            GenericBoxes3D.from_vectors(pred_boxes3d.cpu().numpy()),
            intrinsics=x['intrinsics'],
            extrinsics=x['extrinsics'],
            class_ids=pred_class_ids,
            image_width=img.shape[1],
            metadata=None,
            color=(0, 0, 255),
            bev=bev_obj,
        )

        # By default, ["forward" of body] == ["right" of BEV image].
        # Change it to ["up" of BEV image] by rotating.
        viz_image = cv2.rotate(viz_image, cv2.cv2.ROTATE_90_COUNTERCLOCKWISE)
        # Crop the BEV image to show only frustum.
        viz_image = bev_frustum_crop(viz_image)

        viz_images['viz_boxes3d_bev'] = viz_image

        return viz_images


        Parameters
        ----------
        x: Dict
            One 'dataset_dict'.

        Returns
        -------
        viz_images: Dict[np.array]
            Visualizations as RGB images.
        
tridet/visualizers/box3d_visualizer.py