1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00
dockerfiles/rembg
2024-03-08 17:26:37 +08:00
..
docker-compose.yml add rembg 2024-03-08 17:26:37 +08:00
README.md add rembg 2024-03-08 17:26:37 +08:00

rembg

Rembg is a tool to remove images background.

Web Service

$ docker compose up -d
$ url=https://raw.githubusercontent.com/danielgatis/rembg/master/examples/girl-3.jpg
$ curl -sSL $url -o input.jpg
$ curl -s -G http://localhost:7000/api/remove -d url=$url -o output.png
$ curl -s http://localhost:7000/api/remove -F file=@input.jpg -o output.png

Ad Hoc Commands

# Create an alias
$ alias rembg='docker run --rm -u $(id -u):$(id -g) -v $PWD:/rembg danielgatis/rembg:2'

# Remove the background from a local file
$ rembg i input.png output.png

# Remove the background returning only the mask
$ rembg i -om input.png output.png

# Remove the background applying an alpha matting
$ rembg i -a input.png output.png