Rembg is a tool to remove images background
Fix Docker image
Jan Pokorny2995d97c50e77
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 0000000..66eec88--- /dev/null+++ b/.dockerignore@@ -0,0 +1,8 @@+*+!rembg+!setup.py+!setup.cfg+!requirements.txt+!versioneer.py+!README.md+!pixel.pngdiff --git a/Dockerfile b/Dockerfileindex 0829843..c417829 100644--- a/Dockerfile+++ b/Dockerfile@@ -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/nullENTRYPOINT ["rembg"]CMD []diff --git a/README.md b/README.mdindex f6111e3..646bf7c 100644--- a/README.md+++ b/README.md@@ -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 usagediff --git a/pixel.png b/pixel.pngnew file mode 100644index 0000000..26a8c68Binary files /dev/null and b/pixel.png differdiff --git a/requirements.txt b/requirements.txtindex be1154a..f2e89b8 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,6 +1,6 @@flask==1.1.2-numpy==1.22.0-pillow==8.1.2+numpy==1.20.0+pillow==8.3.2scikit-image==0.19.1torch==1.9.1torchvision==0.10.1