瀏覽代碼

Follow the changes of model downloading #742

catscarlet 5 月之前
父節點
當前提交
602c68dd46
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      Dockerfile_nvidia_cuda_cudnn_gpu
  2. 2 1
      README.md

+ 1 - 1
Dockerfile_nvidia_cuda_cudnn_gpu

@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3-pip pyt
 COPY . .
 COPY . .
 
 
 RUN python -m pip install ".[gpu,cli]" --break-system-packages
 RUN python -m pip install ".[gpu,cli]" --break-system-packages
-RUN rembg d
+RUN rembg d u2net
 
 
 EXPOSE 7000
 EXPOSE 7000
 ENTRYPOINT ["rembg"]
 ENTRYPOINT ["rembg"]

+ 2 - 1
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
 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
 ## Models