提交 0dccfb91 编写于 作者: G gaotingquan

fix: interpolation maybe be 0

上级 1c01d7a7
...@@ -79,7 +79,7 @@ class UnifiedResize(object): ...@@ -79,7 +79,7 @@ class UnifiedResize(object):
if isinstance(interpolation, str): if isinstance(interpolation, str):
interpolation = _cv2_interp_from_str[interpolation.lower()] interpolation = _cv2_interp_from_str[interpolation.lower()]
# compatible with opencv < version 4.4.0 # compatible with opencv < version 4.4.0
elif not interpolation: elif interpolation is None:
interpolation = cv2.INTER_LINEAR interpolation = cv2.INTER_LINEAR
self.resize_func = partial(cv2.resize, interpolation=interpolation) self.resize_func = partial(cv2.resize, interpolation=interpolation)
elif backend.lower() == "pil": elif backend.lower() == "pil":
......
...@@ -60,7 +60,7 @@ class UnifiedResize(object): ...@@ -60,7 +60,7 @@ class UnifiedResize(object):
if isinstance(interpolation, str): if isinstance(interpolation, str):
interpolation = _cv2_interp_from_str[interpolation.lower()] interpolation = _cv2_interp_from_str[interpolation.lower()]
# compatible with opencv < version 4.4.0 # compatible with opencv < version 4.4.0
elif not interpolation: elif interpolation is None:
interpolation = cv2.INTER_LINEAR interpolation = cv2.INTER_LINEAR
self.resize_func = partial(cv2.resize, interpolation=interpolation) self.resize_func = partial(cv2.resize, interpolation=interpolation)
elif backend.lower() == "pil": elif backend.lower() == "pil":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册