rembg is a python library which utilizes Neural Network AI models and ONNX to remove the backgrounds from supplied image files. Can be used as a library or a CLI tool.
#image-processing #background-removal #python #library #ai #neuralnet #machine-learning #ml
|
5 jaren geleden | |
---|---|---|
examples | 5 jaren geleden | |
src | 5 jaren geleden | |
.editorconfig | 5 jaren geleden | |
.gitignore | 5 jaren geleden | |
LICENSE.txt | 5 jaren geleden | |
MANIFEST.in | 5 jaren geleden | |
README.md | 5 jaren geleden | |
pyproject.toml | 5 jaren geleden | |
requirements.txt | 5 jaren geleden | |
setup.cfg | 5 jaren geleden | |
setup.py | 5 jaren geleden |
Rembg is a tool to remove images background. That is it.
Install it from pypi
pip install rembg
Remove the backaground from a remote image
curl -s http://input.png | rembg > output.png
Remove the backaground from a local file
rembg -o path/to/output.png paht/to/input.png
Remove the backaground from all images in a folder
rembg -p path/to/inputs
Start the server
rembg-server
Open your browser to
http://localhost:5000?url=http://image.png
In app.py
import sys
from rembg.bg import remove
sys.stdout.buffer.write(remove(sys.stdin.buffer.read()))
Then run
cat input.png | python app.py > out.png
Copyright (c) 2020-present Daniel Gatis
Licensed under MIT License