Image Segmentation
Transformers
PyTorch
ONNX
Safetensors
Transformers.js
remove background
background
background-removal
Pytorch
vision
legal liability
custom_code
Instructions to use aoiandroid/RMBG-2-Matting with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aoiandroid/RMBG-2-Matting with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="aoiandroid/RMBG-2-Matting", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained("aoiandroid/RMBG-2-Matting", trust_remote_code=True, device_map="auto") - Transformers.js
How to use aoiandroid/RMBG-2-Matting with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'aoiandroid/RMBG-2-Matting'); - Notebooks
- Google Colab
- Kaggle
Download t4.png from aoiandroid/RMBG-2-Matting: direct link, hf CLI and curl.
- Browser
- Download file 2.16 MB
-
https://huggingface.co/aoiandroid/RMBG-2-Matting/resolve/main/t4.png
- Command line
-
hf download hf://aoiandroid/RMBG-2-Matting/t4.png
-
curl -L -o t4.png https://huggingface.co/aoiandroid/RMBG-2-Matting/resolve/main/t4.png
2.16 MB

- Xet hash:
- 3ccf63aff48f3a1bce6178e3b29d3a2dd6f69d34378b48bff8a9e61f8fc22bd6
- Size of remote file:
- 2.16 MB
- SHA256:
- 43a9453f567d9bff7fe4481205575bbf302499379047ee6073247315452ba8fb
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.