diff --git a/rembg/session_base.py b/rembg/session_base.py index df140115..aa98693b 100644 --- a/rembg/session_base.py +++ b/rembg/session_base.py @@ -18,7 +18,7 @@ def normalize( std: Tuple[float, float, float], size: Tuple[int, int], ) -> Dict[str, np.ndarray]: - im = img.convert("RGB").resize(size, Image.Resampling.LANCZOS) + im = img.convert("RGB").resize(size, Image.LANCZOS) im_ary = np.array(im) im_ary = im_ary / np.max(im_ary) diff --git a/rembg/session_simple.py b/rembg/session_simple.py index 511cdca0..7ec31813 100644 --- a/rembg/session_simple.py +++ b/rembg/session_simple.py @@ -25,6 +25,6 @@ def predict(self, img: PILImage) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.Resampling.LANCZOS) + mask = mask.resize(img.size, Image.LANCZOS) return [mask]