Rembg is a tool to remove images background
fix gpu
Daniel Gatis358d2e19bc68
diff --git a/.dockerignore b/.dockerignoreindex 66eec88..69f5c22 100644--- a/.dockerignore+++ b/.dockerignore@@ -3,6 +3,8 @@!setup.py!setup.cfg!requirements.txt+!requirements-cpu.txt+!requirements-gpu.txt!versioneer.py!README.md!pixel.pngdiff --git a/Dockerfile b/Dockerfileindex 048fc54..d06acdd 100644--- a/Dockerfile+++ b/Dockerfile@@ -12,9 +12,7 @@ WORKDIR /rembgCOPY . .RUN GPU=1 pip3 install .--# First run to compile AOT & download model-RUN rembg pixel.png >/dev/null+RUN rembg i pixel.png > /dev/nullENTRYPOINT ["rembg"]CMD []diff --git a/rembg/detect.py b/rembg/detect.pyindex b8f710a..9cfddf7 100644--- a/rembg/detect.py+++ b/rembg/detect.py@@ -30,7 +30,7 @@ def ort_session(model_name: str) -> ort.InferenceSession:with redirect_stdout(sys.stderr):gdown.cached_download(url, path, md5=md5)- return ort.InferenceSession(path)+ return ort.InferenceSession(path, providers=ort.get_available_providers())def norm_pred(d: np.ndarray) -> np.ndarray:diff --git a/requirements.txt b/requirements.txtindex be9af40..7e673fd 100644--- a/requirements.txt+++ b/requirements.txt@@ -4,7 +4,7 @@ click==8.0.3fastapi==0.72.0filetype==1.0.9gdown==4.2.0-numpy==1.22.1+numpy==1.21.5pillow==9.0.0pymatting==1.1.5python-multipart==0.0.5