Skip to content

Commit

Permalink
fix python version
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgatis committed Apr 20, 2022
1 parent 8bc1627 commit f19ec10
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
22 changes: 14 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
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 \
build-essential
ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y
RUN apt upgrade -y
RUN apt install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y curl python3.9 python3.9-distutils
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.9

WORKDIR /rembg

COPY . .
RUN python3.9 -m pip install .[gpu]

RUN ["pip3", "install", ".[gpu]"]
RUN mkdir -p ~/.u2net
RUN gdown https://drive.google.com/uc?id=1tNuFmLv0TSNDjYIkjEdeH1IWKQdUA4HR -O ~/.u2net/u2netp.onnx
RUN gdown https://drive.google.com/uc?id=1tCU5MM1LhRgGou5OpmpjBQbSrYIUoYab -O ~/.u2net/u2net.onnx
RUN gdown https://drive.google.com/uc?id=1ZfqwVxu-1XWC1xU1GHIP-FM_Knd_AX5j -O ~/.u2net/u2net_human_seg.onnx

ENTRYPOINT ["rembg"]
CMD []
CMD ["--help"]
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ Rembg is a tool to remove images background. That is it.

**If this project has helped you in any way, please consider making a [donation](https://www.buymeacoffee.com/danielgatis).**


### Installation

**!! This library is for Python 3.9 only !!**.

CPU support:
```bash
pip install rembg
Expand Down Expand Up @@ -129,16 +132,10 @@ cv2.imwrite(output_path, output)

### Usage as a docker

First compile with:

```
docker build . -t rembg
```

Then run with:
Try this:

```
docker run --rm -i rembg i in.png out.png
cat in.png | docker run -i --rm danielgatis/rembg i > out.png
```

### Advance usage
Expand Down

0 comments on commit f19ec10

Please sign in to comment.