Skip to content

armgit / rembg

Public Imported from GitHub
0

Rembg is a tool to remove images background

Follow the changes of model downloading #742

catscarlet602c68dd46b4
diff --git a/Dockerfile_nvidia_cuda_cudnn_gpu b/Dockerfile_nvidia_cuda_cudnn_gpu
index 4eecb79..1b86279 100644
--- a/Dockerfile_nvidia_cuda_cudnn_gpu
+++ b/Dockerfile_nvidia_cuda_cudnn_gpu
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3-pip pyt
COPY . .
RUN python -m pip install ".[gpu,cli]" --break-system-packages
-RUN rembg d
+RUN rembg d u2net
EXPOSE 7000
ENTRYPOINT ["rembg"]
diff --git a/README.md b/README.md
index 71fa722..76bc374 100644
--- a/README.md
+++ b/README.md
@@ -367,7 +367,8 @@ After you build the image, run it like this as a cli
sudo docker run --rm -it --gpus all -v /dev/dri:/dev/dri -v $PWD:/rembg rembg-nvidia-cuda-cudnn-gpu i -m birefnet-general input.png output.png
```
-Trick: Actually you can also make up a nvidia-cuda-cudnn-gpu image and install rembg[gpu, cli] in it.
+- Trick 1: Actually you can also make up a nvidia-cuda-cudnn-gpu image and install rembg[gpu, cli] in it.
+- Trick 2: Try param `-v /somewhereYouStoresModelFiles/:/root/.u2net` so to download/store model files out of docker images. You can even comment the line `RUN rembg d u2net` so when builing the image, it download will no models, so you can download the specific model you want even without the default u2net model.
## Models