change the default interpolation of pil from `NEAREST` to `BILINEAR` (same to cv2 backend)

pull/2734/head
Yang Nie 2022-08-08 17:57:45 +08:00 committed by Tingquan Gao
parent 00a2863414
commit 3b8b39644f
2 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,8 @@ class UnifiedResize(object):
elif backend.lower() == "pil":
if isinstance(interpolation, str):
interpolation = _pil_interp_from_str[interpolation.lower()]
elif interpolation is None:
interpolation = Image.BILINEAR
self.resize_func = partial(
_pil_resize, resample=interpolation, return_numpy=return_numpy)
else:

View File

@ -99,6 +99,8 @@ class UnifiedResize(object):
elif backend.lower() == "pil":
if isinstance(interpolation, str):
interpolation = _pil_interp_from_str[interpolation.lower()]
elif interpolation is None:
interpolation = Image.BILINEAR
self.resize_func = partial(
_pil_resize, resample=interpolation, return_numpy=return_numpy)
else: