From 640d04d4e7fa95c1c32c8f833064ee6dc9d3b7af Mon Sep 17 00:00:00 2001 From: "Mr. For Example" <62230687+MrForExample@users.noreply.github.com> Date: Sat, 13 Apr 2024 19:44:56 +0200 Subject: [PATCH] Remove rembg dependency --- tsr/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsr/utils.py b/tsr/utils.py index fc942d1..3b07fa6 100644 --- a/tsr/utils.py +++ b/tsr/utils.py @@ -7,7 +7,6 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Union import imageio import numpy as np import PIL.Image -import rembg import torch import torch.nn as nn import torch.nn.functional as F @@ -404,6 +403,7 @@ def remove_background( force: bool = False, **rembg_kwargs, ) -> PIL.Image.Image: + import rembg do_remove = True if image.mode == "RGBA" and image.getextrema()[3][0] < 255: do_remove = False