Quickly run a web interface and API service based on the RMBG-2.0 model.
huggingface-cli download --resume-download briaai/RMBG-2.0 --local-dir RMBG-2.0
git clone https://github.com/Valdanitooooo/RMBG2-docker.git
Rename .env_example
to .env
and change the value of MODEL_DIR
to the correct model weight directory.
You can use the image I have already published to Dockerhub
docker-compose up -d
docker-compose -f docker-compose-cpu.yml up -d
Modify /models/RMBG-2.0
in the main.py
file to point to the correct model weight path.
conda create -n rmbg2 python=3.10 && conda activate rmbg2
pip install -r requirements.txt
python app/main.py
Upload image or provide URL to remove background
- Request method: POST
- URL: http://localhost:9006/api/remove-bg
- Request body: Contains a form data named file