def __call__(self, dataset_dict):
        """
        Args:
            dataset_dict (dict): Metadata of one image, in Detectron2 Dataset format.

        Returns:
            dict: a format that builtin models in detectron2 accept
        """
        dataset_dict = copy.deepcopy(dataset_dict)  # it will be modified by code below
        # USER: Write your own image loading if it's not from a file
        image = d2_utils.read_image(dataset_dict["file_name"], format=self.image_format)
        d2_utils.check_image_size(dataset_dict, image)

        # USER: Remove if you don't do semantic/panoptic seglmentation.
        semseg_gt, depth_gt, intrinsics, pose = None, None, None, None
        if "sem_seg_file_name" in dataset_dict:
            semseg_gt = d2_utils.read_image(dataset_dict.pop("sem_seg_file_name"), "L").squeeze(2)

        aug_input = T.AugInput(image, sem_seg=semseg_gt)
        # (dennis.park) `self.augmentations` is [(RandomCrop,) ResizeShortestEdge, (RandomFlip), (ColorJitter)]
        transforms = self.augmentations(aug_input)
        image, semseg2d_gt = aug_input.image, aug_input.sem_seg

        image_shape = image.shape[:2]  # h, w
        # Pytorch's dataloader is efficient on torch.Tensor due to shared-memory,
        # but not efficient on large generic data structures due to the use of pickle & mp.Queue.
        # Therefore it's important to use torch.Tensor.
        dataset_dict["image"] = torch.as_tensor(np.ascontiguousarray(image.transpose(2, 0, 1)))
        if semseg2d_gt is not None:
            dataset_dict["semseg2d"] = torch.as_tensor(semseg2d_gt.astype("long"))

        # `transforms` apply the following transformations in order:
        #   1. (optional) CropTransform
        #   2. ResizeTransform
        #   3. (optional) FlipTransform
        #   4. (optional) color jittering tranforms (brightness, saturation, contrast).
        # See `multitask.data.augmentations.build.py`
        # If you add other transformations, then consider if they have to support intrinsics, 3D bbox, depth. etc.
        # See crop_transform.py, resize_transform.py, flip_transform.py for examples.

        if "depth_file_name" in dataset_dict:
            depth_gt = np.load(dataset_dict.pop("depth_file_name"))['data']
            depth_gt = transforms.apply_depth(depth_gt)
            dataset_dict["depth"] = torch.as_tensor(depth_gt)

        intrinsics = None
        if "intrinsics" in dataset_dict:
            intrinsics = np.reshape(
                dataset_dict["intrinsics"],
                (3, 3),
            ).astype(np.float32)
            intrinsics = transforms.apply_intrinsics(intrinsics)
            dataset_dict["intrinsics"] = torch.as_tensor(intrinsics)
            dataset_dict["inv_intrinsics"] = torch.as_tensor(np.linalg.inv(intrinsics))

        if "pose" in dataset_dict:
            pose = Pose(wxyz=np.float32(dataset_dict["pose"]["wxyz"]), tvec=np.float32(dataset_dict["pose"]["tvec"]))
            dataset_dict["pose"] = pose
            # NOTE: no transforms affect global pose.

        if "extrinsics" in dataset_dict:
            extrinsics = Pose(
                wxyz=np.float32(dataset_dict["extrinsics"]["wxyz"]),
                tvec=np.float32(dataset_dict["extrinsics"]["tvec"])
            )
            dataset_dict["extrinsics"] = extrinsics

        if not self.task_manager.has_detection_task:
            dataset_dict.pop("annotations", None)

        if "annotations" in dataset_dict:

            for anno in dataset_dict["annotations"]:
                if not self.task_manager.has_detection_task:
                    anno.pop("bbox", None)
                    anno.pop("bbox_mode", None)
                if not self.task_manager.box3d_on:
                    anno.pop("bbox3d", None)

            annos = [
                transform_instance_annotations(
                    obj,
                    transforms,
                    image_shape,
                ) for obj in dataset_dict["annotations"] if obj.get("iscrowd", 0) == 0
            ]

            if annos and 'bbox3d' in annos[0]:
                # Remove boxes with negative z-value for center.
                annos = [anno for anno in annos if anno['bbox3d'][6] > 0]

            instances = annotations_to_instances(
                annos,
                image_shape,
                intrinsics=intrinsics,
            )

            if self.is_train:
                instances = d2_utils.filter_empty_instances(instances)
            dataset_dict["instances"] = instances

        return dataset_dict

        Args:
            dataset_dict (dict): Metadata of one image, in Detectron2 Dataset format.

        Returns:
            dict: a format that builtin models in detectron2 accept
        
tridet/data/dataset_mappers/dataset_mapper.py