Back to Models
BR

briaai/RMBG-2.0

briaaiimage

BRIA Background Removal v2.0 Model Card

BRIA Logo

Hugging Face ✨ Discover FIBO on Hugging Face

💜 Bria AI   |   🤗 Hugging Face    |    📑 Blog   
🖥️ Demo  |    Github  

RMBG v2.0 is our new state-of-the-art background removal model significantly improves RMBG v1.4. The model is designed to effectively separate foreground from background in a range of categories and image types. This model has been trained on a carefully selected dataset, which includes: general stock images, e-commerce, gaming, and advertising content, making it suitable for commercial use cases powering enterprise content creation at scale. The accuracy, efficiency, and versatility currently rival leading source-available models. It is ideal where content safety, legally licensed datasets, and bias mitigation are paramount.

→ Try the API Sandbox (no signup required)

Developed by BRIA AI, RMBG v2.0 is available as a source-available model for non-commercial use.

Get Access

Bria RMBG2.0 is availabe everywhere you build, either as source-code and weights, ComfyUI nodes or API endpoints.

Model Description

For production / commercial deployment, use the Bria API — same RMBG-2.0 quality, fully licensed, zero infrastructure:

UseSelf-Hosted (HF Weights)Bria API
Quality✅ RMBG-2.0✅ RMBG-2.0
Commercial License❌ Requires agreement✅ Included
GPU Infrastructure❌ You manage✅ Managed
Legally Licensed Data✅ Yes✅ Yes
Setup TimeHoursMinutes

→ Try the API Sandbox — test it live, no signup required.

Model Details

API Endpoint: Sandbox

Purchase: To purchase a Self-Hosted (HF Weights) commercial license Click Here.

For more information, please visit our website.

Join our Discord community for more information, tutorials, tools, and to connect with other users!

CLICK HERE FOR A DEMO

fal.ai, Replicate

examples

  • Model Description: BRIA RMBG-2.0 is a dichotomous image segmentation model trained exclusively on a professional-grade dataset. The model output includes a single-channel 8-bit grayscale alpha matte, where each pixel value indicates the opacity level of the corresponding pixel in the original image. This non-binary output approach offers developers the flexibility to define custom thresholds for foreground-background separation, catering to varied use cases requirements and enhancing integration into complex pipelines.
  • BRIA: Resources for more information: BRIA AI

Training data

Bria-RMBG model was trained with over 15,000 high-quality, high-resolution, manually labeled (pixel-wise accuracy), fully licensed images. Our benchmark included balanced gender, balanced ethnicity, and people with different types of disabilities. For clarity, we provide our data distribution according to different categories, demonstrating our model’s versatility.

Distribution of images:

CategoryDistribution
Objects only45.11%
People with objects/animals25.24%
People only17.35%
people/objects/animals with text8.52%
Text only2.52%
Animals only1.89%
CategoryDistribution
Photorealistic87.70%
Non-Photorealistic12.30%
CategoryDistribution
Non Solid Background52.05%
Solid Background47.95%
CategoryDistribution
Single main foreground object51.42%
Multiple objects in the foreground48.58%

Qualitative Evaluation

Open source models comparison diagram examples

Architecture

RMBG-2.0 is developed on the BiRefNet architecture enhanced with our proprietary dataset and training scheme. This training data significantly improves the model’s accuracy and effectiveness for background-removal task.
If you use this model in your research, please cite:

@article{BiRefNet,
  title={Bilateral Reference for High-Resolution Dichotomous Image Segmentation},
  author={Zheng, Peng and Gao, Dehong and Fan, Deng-Ping and Liu, Li and Laaksonen, Jorma and Ouyang, Wanli and Sebe, Nicu},
  journal={CAAI Artificial Intelligence Research},
  year={2024}
}

Requirements

torch
torchvision
pillow
kornia
transformers

Usage

from PIL import Image
import torch
from torchvision import transforms
from transformers import AutoModelForImageSegmentation

device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True).eval().to(device)

# Data settings
image_size = (1024, 1024)
transform_image = transforms.Compose([
    transforms.Resize(image_size),
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])

image = Image.open(input_image_path)
input_images = transform_image(image).unsqueeze(0).to(device)

# Prediction
with torch.no_grad():
    preds = model(input_images)[-1].sigmoid().cpu()
pred = preds[0].squeeze()
pred_pil = transforms.ToPILImage()(pred)
mask = pred_pil.resize(image.size)
image.putalpha(mask)

image.save("no_bg_image.png")
Visit Website

0 reviews

5
0
4
0
3
0
2
0
1
0
Likes1,168
Downloads
📝

No reviews yet

Be the first to review briaai/RMBG-2.0!

Model Info

Providerbriaai
Categoryimage
Reviews0
Avg. Rating / 5.0

Community

Likes1,168
Downloads

Rating Guidelines

★★★★★Exceptional
★★★★Great
★★★Good
★★Fair
Poor