Rembg is a tool to remove images background
update docker
Daniel Gatis525dac130220
diff --git a/Dockerfile b/Dockerfileindex 3d81f3b..86e1252 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,12 +1,18 @@-FROM nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04+FROM nvidia/cuda:11.6.0-runtime-ubuntu18.04ENV DEBIAN_FRONTEND noninteractive+RUN rm /etc/apt/sources.list.d/cuda.list || true+RUN rm /etc/apt/sources.list.d/nvidia-ml.list || true+RUN apt-key del 7fa2af80+RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub+RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub+RUN apt update -yRUN apt upgrade -y-RUN apt install -y software-properties-common+RUN apt install -y curl software-properties-commonRUN add-apt-repository ppa:deadsnakes/ppa-RUN apt install -y curl python3.9 python3.9-distutils+RUN apt install -y python3.9 python3.9-distutilsRUN curl https://bootstrap.pypa.io/get-pip.py | python3.9WORKDIR /rembg@@ -20,5 +26,6 @@ RUN gdown https://drive.google.com/uc?id=1tCU5MM1LhRgGou5OpmpjBQbSrYIUoYab -O ~/RUN gdown https://drive.google.com/uc?id=1ZfqwVxu-1XWC1xU1GHIP-FM_Knd_AX5j -O ~/.u2net/u2net_human_seg.onnxRUN gdown https://drive.google.com/uc?id=15rKbQSXQzrKCQurUjZFg8HqzZad8bcyz -O ~/.u2net/u2net_cloth_seg.onnx+EXPOSE 5000ENTRYPOINT ["rembg"]CMD ["--help"]diff --git a/README.md b/README.mdindex fb0806b..6372826 100644--- a/README.md+++ b/README.md@@ -75,9 +75,14 @@ Start the serverrembg s```-Open your browser to+Image with background:```-http://localhost:5000?url=http://image.png+https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Gull_portrait_ca_usa.jpg/1280px-Gull_portrait_ca_usa.jpg+```++Image without background:+```+http://localhost:5000/?url=https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Gull_portrait_ca_usa.jpg/1280px-Gull_portrait_ca_usa.jpg```Also you can send the file as a FormData (multipart/form-data):@@ -135,7 +140,17 @@ cv2.imwrite(output_path, output)Try this:```-cat in.png | docker run -i --rm danielgatis/rembg i > out.png+docker run -p 5000:5000 rembg s+```++Image with background:+```+https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Gull_portrait_ca_usa.jpg/1280px-Gull_portrait_ca_usa.jpg+```++Image without background:+```+http://localhost:5000/?url=https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Gull_portrait_ca_usa.jpg/1280px-Gull_portrait_ca_usa.jpg```### Models