diff --git a/deploy/python/preprocess.py b/deploy/python/preprocess.py index 5e42851f1557d1c95d6622e7e82c76b9cf8a1f60..c5b5e7cd078eb998cb9913055401785a5eb122f0 100644 --- a/deploy/python/preprocess.py +++ b/deploy/python/preprocess.py @@ -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: diff --git a/ppcls/data/preprocess/ops/operators.py b/ppcls/data/preprocess/ops/operators.py index e290223c8a4fcf15bf3b93ae4eb7134dd1339521..0d6653a889da526ca52920fbe12e1ecbaf77530e 100644 --- a/ppcls/data/preprocess/ops/operators.py +++ b/ppcls/data/preprocess/ops/operators.py @@ -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: