fix: interpolation maybe be 0

pull/1277/head
gaotingquan 2021-09-30 06:49:41 +00:00
parent 1c01d7a74e
commit 0dccfb917d
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ class UnifiedResize(object):
if isinstance(interpolation, str):
interpolation = _cv2_interp_from_str[interpolation.lower()]
# compatible with opencv < version 4.4.0
elif not interpolation:
elif interpolation is None:
interpolation = cv2.INTER_LINEAR
self.resize_func = partial(cv2.resize, interpolation=interpolation)
elif backend.lower() == "pil":

View File

@ -60,7 +60,7 @@ class UnifiedResize(object):
if isinstance(interpolation, str):
interpolation = _cv2_interp_from_str[interpolation.lower()]
# compatible with opencv < version 4.4.0
elif not interpolation:
elif interpolation is None:
interpolation = cv2.INTER_LINEAR
self.resize_func = partial(cv2.resize, interpolation=interpolation)
elif backend.lower() == "pil":