diff --git a/rembg/bg.py b/rembg/bg.py index ea1a69ed..071af09d 100644 --- a/rembg/bg.py +++ b/rembg/bg.py @@ -120,7 +120,7 @@ def remove( alpha_matting_background_threshold, alpha_matting_erode_size, ) - except: + except ValueError: cutout = naive_cutout(img, mask) else: diff --git a/rembg/session_cloth.py b/rembg/session_cloth.py index 51b2a910..ada82da8 100644 --- a/rembg/session_cloth.py +++ b/rembg/session_cloth.py @@ -6,28 +6,50 @@ from .session_base import BaseSession -# fmt: off pallete1 = [ - 0, 0, 0, # background - 255, 255, 255, # upper body - 0, 0, 0, # lower body - 0, 0, 0, # full body + 0, + 0, + 0, + 255, + 255, + 255, + 0, + 0, + 0, + 0, + 0, + 0, ] pallete2 = [ - 0, 0, 0, # background - 0, 0, 0, # upper body - 255, 255, 255, # lower body - 0, 0, 0, # full body + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 0, + 0, + 0, ] pallete3 = [ - 0, 0, 0, # background - 0, 0, 0, # upper body - 0, 0, 0, # lower body - 255, 255, 255, # full body + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, ] -# fmt: on class ClothSession(BaseSession):