mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-14 17:35:55 +08:00
fix issue 116
This commit is contained in:
parent
4e64eccb44
commit
ae46588c7e
2
setup.py
2
setup.py
@ -11,7 +11,7 @@ with open("requirements.txt") as f:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="rembg",
|
name="rembg",
|
||||||
version="1.0.26",
|
version="1.0.27",
|
||||||
description="Remove image background",
|
description="Remove image background",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
@ -92,6 +92,7 @@ def remove(
|
|||||||
mask = detect.predict(model, np.array(img)).convert("L")
|
mask = detect.predict(model, np.array(img)).convert("L")
|
||||||
|
|
||||||
if alpha_matting:
|
if alpha_matting:
|
||||||
|
try:
|
||||||
cutout = alpha_matting_cutout(
|
cutout = alpha_matting_cutout(
|
||||||
img,
|
img,
|
||||||
mask,
|
mask,
|
||||||
@ -100,6 +101,8 @@ def remove(
|
|||||||
alpha_matting_erode_structure_size,
|
alpha_matting_erode_structure_size,
|
||||||
alpha_matting_base_size,
|
alpha_matting_base_size,
|
||||||
)
|
)
|
||||||
|
except:
|
||||||
|
cutout = naive_cutout(img, mask)
|
||||||
else:
|
else:
|
||||||
cutout = naive_cutout(img, mask)
|
cutout = naive_cutout(img, mask)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user