Skip to content

Commit

Permalink
fix antialising (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 authored Sep 26, 2023
1 parent 28e5375 commit f0ea666
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doctr/models/preprocessor/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f0ea666

Please sign in to comment.