diff --git a/rembg/sessions/base.py b/rembg/sessions/base.py index f9428400..ec9c0372 100644 --- a/rembg/sessions/base.py +++ b/rembg/sessions/base.py @@ -46,7 +46,7 @@ def normalize( *args, **kwargs ) -> Dict[str, np.ndarray]: - im = img.convert("RGB").resize(size, Image.LANCZOS) + im = img.convert("RGB").resize(size, Image.Resampling.LANCZOS) im_ary = np.array(im) im_ary = im_ary / np.max(im_ary) diff --git a/rembg/sessions/dis_anime.py b/rembg/sessions/dis_anime.py index 01e9a2a5..33d09a75 100644 --- a/rembg/sessions/dis_anime.py +++ b/rembg/sessions/dis_anime.py @@ -40,7 +40,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/dis_general_use.py b/rembg/sessions/dis_general_use.py index fb1290dc..f19b0ed7 100644 --- a/rembg/sessions/dis_general_use.py +++ b/rembg/sessions/dis_general_use.py @@ -36,7 +36,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/silueta.py b/rembg/sessions/silueta.py index 7851387a..574a33c3 100644 --- a/rembg/sessions/silueta.py +++ b/rembg/sessions/silueta.py @@ -42,7 +42,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/u2net.py b/rembg/sessions/u2net.py index 1c9359ee..9cf8cf66 100644 --- a/rembg/sessions/u2net.py +++ b/rembg/sessions/u2net.py @@ -42,7 +42,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/u2net_cloth_seg.py b/rembg/sessions/u2net_cloth_seg.py index b3587d10..aaac286c 100644 --- a/rembg/sessions/u2net_cloth_seg.py +++ b/rembg/sessions/u2net_cloth_seg.py @@ -87,7 +87,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred, 0) mask = Image.fromarray(pred.astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) masks = [] diff --git a/rembg/sessions/u2net_custom.py b/rembg/sessions/u2net_custom.py index b984208d..a5139170 100644 --- a/rembg/sessions/u2net_custom.py +++ b/rembg/sessions/u2net_custom.py @@ -68,7 +68,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/u2net_human_seg.py b/rembg/sessions/u2net_human_seg.py index 8c80db10..170e5abd 100644 --- a/rembg/sessions/u2net_human_seg.py +++ b/rembg/sessions/u2net_human_seg.py @@ -42,7 +42,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask] diff --git a/rembg/sessions/u2netp.py b/rembg/sessions/u2netp.py index 94b0f167..2988afdb 100644 --- a/rembg/sessions/u2netp.py +++ b/rembg/sessions/u2netp.py @@ -38,7 +38,7 @@ def predict(self, img: PILImage, *args, **kwargs) -> List[PILImage]: pred = np.squeeze(pred) mask = Image.fromarray((pred * 255).astype("uint8"), mode="L") - mask = mask.resize(img.size, Image.LANCZOS) + mask = mask.resize(img.size, Image.Resampling.LANCZOS) return [mask]