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
RuntimeError: This model introduces a custom pipeline without specifying its implementation.
#43
by keshav-writes-code - opened
so, while running the default google colab notebook, i got this
from transformers import pipeline
pipe = pipeline("image-segmentation", model="briaai/RMBG-2.0", trust_remote_code=True)
RuntimeError Traceback (most recent call last)
/tmp/ipython-input-4702/1249673979.py in <cell line: 0>()
2 from transformers import pipeline
3
----> 4 pipe = pipeline("image-segmentation", model="briaai/RMBG-2.0", trust_remote_code=True)
1 frames
/usr/local/lib/python3.12/dist-packages/transformers/pipelines/__init__.py in clean_custom_task(task_info)
531
532 if "impl" not in task_info:
--> 533 raise RuntimeError("This model introduces a custom pipeline without specifying its implementation.")
534 pt_class_names = task_info.get("pt", ())
535 if isinstance(pt_class_names, str):
RuntimeError: This model introduces a custom pipeline without specifying its implementation.