def pre_process(self, first_frame: torch.Tensor, last_frame: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
        """Resize inputs to dimensions required by backbone.

        Args:
            first_frame (torch.Tensor): Starting frame of optical flow computation.
            last_frame (torch.Tensor): Last frame of optical flow computation.

        Returns:
            tuple[torch.Tensor, torch.Tensor]: Preprocessed first and last frame.
        """
        first_frame = F.resize(first_frame, size=[520, 960], antialias=False)
        last_frame = F.resize(last_frame, size=[520, 960], antialias=False)
        return self.transforms(first_frame, last_frame)
Resize inputs to dimensions required by backbone.

        Args:
            first_frame (torch.Tensor): Starting frame of optical flow computation.
            last_frame (torch.Tensor): Last frame of optical flow computation.

        Returns:
            tuple[torch.Tensor, torch.Tensor]: Preprocessed first and last frame.
        
src/anomalib/models/video/ai_vad/flow.py