From 602c68dd46b404d325fc75f84122f148daaa769c Mon Sep 17 00:00:00 2001 From: catscarlet Date: Wed, 26 Mar 2025 00:54:22 +0800 Subject: [PATCH] Follow the changes of model downloading #742 --- Dockerfile_nvidia_cuda_cudnn_gpu | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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