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
Add birefnet model_type and tag
#22
by Xenova HF Staff - opened
OriLib changed pull request status to merged
This comment has been hidden
@Xenova i'm having problems due to this update:
"You are using a model of type birefnet to instantiate a model of type SegformerForSemanticSegmentation. This is not supported for all configurations of models and can yield errors."
also, when saving locally and loading i'm getting the following:
"Unrecognized model in rmbg/1/rmbg. Should have a model_type key in its config.json, or contain one of the following strings in its name: "
when adding model_type to config.json i get:
"The checkpoint you are trying to load has model type birefnet but Transformers does not recognize this architecture."
do you have a solution? should i revert this PR?