def preprocess_image(self, batched_inputs: List[Dict[str, torch.Tensor]]):
        """
        Normalize, pad and batch the input images.
        """
        images = [self._move_to_current_device(x["image"]) for x in batched_inputs]
        images = [(x - self.pixel_mean) / self.pixel_std for x in images]

        # TODO: modify square_size when necessary to avoid negative padding
        max_size = 0
        for img in images:
            _, h, w = img.shape
            if max(h, w) > max_size:
                max_size = max(h, w)
        padding_constraints = copy.deepcopy(self.backbone.padding_constraints)
        if 'square_size' in self.backbone.padding_constraints:
            square_size = self.backbone.padding_constraints['square_size']
            if square_size < max_size and square_size != 0:
                warnings.warn("square_size={}, is smaller than max_size={} in batch".format(
                    self.backbone.padding_constraints['square_size'], max_size))
                padding_constraints['square_size'] = max_size

        images = ImageList.from_tensors(
            images,
            self.backbone.size_divisibility,
            padding_constraints=padding_constraints,
        )
        return images

        Normalize, pad and batch the input images.
        
EVA-02/det/detectron2/modeling/meta_arch/rcnn.py