Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgatis committed May 23, 2024
1 parent f13083b commit 747ef5e
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rembg/sessions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/dis_anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/dis_general_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/silueta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/u2net.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/u2net_cloth_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/u2net_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/u2net_human_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion rembg/sessions/u2netp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 747ef5e

Please sign in to comment.