mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-16 17:15:53 +08:00
fix linters
This commit is contained in:
parent
f13083b55d
commit
747ef5e793
@ -46,7 +46,7 @@ class BaseSession:
|
||||
*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)
|
||||
|
@ -40,7 +40,7 @@ class DisSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -36,7 +36,7 @@ class DisSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -42,7 +42,7 @@ class SiluetaSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -42,7 +42,7 @@ class U2netSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -87,7 +87,7 @@ class Unet2ClothSession(BaseSession):
|
||||
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 = []
|
||||
|
||||
|
@ -68,7 +68,7 @@ class U2netCustomSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -42,7 +42,7 @@ class U2netHumanSegSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
@ -38,7 +38,7 @@ class U2netpSession(BaseSession):
|
||||
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]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user