From 84a21b4175c64feef00785416993b7c0e1f2fd7f Mon Sep 17 00:00:00 2001 From: Daniel Gatis Date: Thu, 21 Apr 2022 22:38:06 -0300 Subject: [PATCH] add more models --- rembg/bg.py | 2 +- rembg/session_cloth.py | 50 ++++++++++++++++++++++++++++++------------ 2 files changed, 37 insertions(+), 15 deletions(-) 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):