@@ -0,0 +1,8 @@
+*
+!rembg
+!setup.py
+!setup.cfg
+!requirements.txt
+!versioneer.py
+!README.md
+!pixel.png
@@ -1,7 +1,20 @@
FROM nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
-RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-dev llvm llvm-dev
-RUN pip3 install rembg
+RUN apt-get update &&\
+ apt-get install -y --no-install-recommends \
+ python3 \
+ python3-pip \
+ python3-dev \
+ build-essential
+
+WORKDIR /rembg
+COPY . .
+RUN pip3 install .
+# First run to compile AOT & download model
+RUN rembg pixel.png >/dev/null
ENTRYPOINT ["rembg"]
CMD []
@@ -158,10 +158,16 @@ python app.py
### Usage as a docker
-Just run
+First compile with:
```
-curl -s http://input.png | docker run -i -v ~/.u2net:/root/.u2net danielgatis/rembg:latest > output.png
+docker build . -t rembg
+```
+Then run with:
+docker run --rm -i rembg <in.png >out.png
### Advance usage
@@ -1,6 +1,6 @@
flask==1.1.2
-numpy==1.22.0
-pillow==8.1.2
+numpy==1.20.0
+pillow==8.3.2
scikit-image==0.19.1
torch==1.9.1
torchvision==0.10.1