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
from_pretrained()
Could you please explain how to use your model locally? Where can I get access to use AutoModelForImageSegmentation.from_pretrained()? Currently, it returns an authorization error.
private
OMG, please explain how to use the code you provided in the “usage” section. I’m getting the following error:
You are trying to access a gated repo.
Make sure to have access to it at https://huggingface.co/briaai/RMBG-2.0.
401 Client Error. (Request ID: Root=1-682b2936-4a8b9124358c2d3977cfd314;86cc6839-4652-4086-8dd6-c5ba66e97bb6)
Cannot access gated repo for url https://huggingface.co/briaai/RMBG-2.0/resolve/main/config.json.
Access to model briaai/RMBG-2.0 is restricted. You must have access to it and be authenticated to access it. Please log in.
How can I get approval to test the code you published?