Merge pull request #746 from catscarlet/main

Follow the changes of model downloading #742
This commit is contained in:
Daniel Gatis 2025-03-26 00:18:15 -03:00 committed by GitHub
commit 9c574fd094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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"]

View File

@ -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