提交 3b8b3964 编写于 作者: Y Yang Nie 提交者: Tingquan Gao

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

上级 00a28634
...@@ -100,6 +100,8 @@ class UnifiedResize(object): ...@@ -100,6 +100,8 @@ class UnifiedResize(object):
elif backend.lower() == "pil": elif backend.lower() == "pil":
if isinstance(interpolation, str): if isinstance(interpolation, str):
interpolation = _pil_interp_from_str[interpolation.lower()] interpolation = _pil_interp_from_str[interpolation.lower()]
elif interpolation is None:
interpolation = Image.BILINEAR
self.resize_func = partial( self.resize_func = partial(
_pil_resize, resample=interpolation, return_numpy=return_numpy) _pil_resize, resample=interpolation, return_numpy=return_numpy)
else: else:
......
...@@ -99,6 +99,8 @@ class UnifiedResize(object): ...@@ -99,6 +99,8 @@ class UnifiedResize(object):
elif backend.lower() == "pil": elif backend.lower() == "pil":
if isinstance(interpolation, str): if isinstance(interpolation, str):
interpolation = _pil_interp_from_str[interpolation.lower()] interpolation = _pil_interp_from_str[interpolation.lower()]
elif interpolation is None:
interpolation = Image.BILINEAR
self.resize_func = partial( self.resize_func = partial(
_pil_resize, resample=interpolation, return_numpy=return_numpy) _pil_resize, resample=interpolation, return_numpy=return_numpy)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册