diff --git a/doctr/models/preprocessor/pytorch.py b/doctr/models/preprocessor/pytorch.py index 98819bade1..2f9586173e 100644 --- a/doctr/models/preprocessor/pytorch.py +++ b/doctr/models/preprocessor/pytorch.py @@ -101,7 +101,9 @@ def __call__(self, x: Union[torch.Tensor, np.ndarray, List[Union[torch.Tensor, n raise TypeError("unsupported data type for torch.Tensor") # Resizing if x.shape[-2] != self.resize.size[0] or x.shape[-1] != self.resize.size[1]: - x = F.resize(x, self.resize.size, interpolation=self.resize.interpolation) + x = F.resize( + x, self.resize.size, interpolation=self.resize.interpolation, antialias=self.resize.antialias + ) # Data type if x.dtype == torch.uint8: # type: ignore[union-attr] x = x.to(dtype=torch.float32).div(255).clip(0, 1) # type: ignore[union-attr]