Image Segmentation
Transformers
PyTorch
ONNX
Safetensors
Transformers.js
remove background
background
background-removal
Pytorch
vision
legal liability
custom_code
Instructions to use briaai/RMBG-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use briaai/RMBG-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="briaai/RMBG-2.0", trust_remote_code=True)# Load model directly from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-2.0", trust_remote_code=True, dtype="auto") - Transformers.js
How to use briaai/RMBG-2.0 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'briaai/RMBG-2.0'); - Inference
- Notebooks
- Google Colab
- Kaggle
Model fails to load using Transformers 4.49.0
#20
by alexsafayan - opened
Using Transformers 4.49.0, model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True) results in this error:
AttributeError: 'Config' object has no attribute 'get_text_config'
It works on Transformers 4.48.0.
@alexsafayan - Thank you so much for posting this 🤗 - was driving me insane. 4.48.0 worked like you said.
thanks you so much - was driving me crazy too
thanks @alexsafayan , it is fixed now.
But why do I get an error no matter if it's version 4.49 or 4.48? Q_Q just like => No module named 'transformers_modules.RMBG-2