๐ BRIA Background Removal v1.4 Model Card
RMBG v1.4 is a state - of - the - art background removal model. It can effectively separate the foreground from the background in various categories and image types. Trained on a carefully - selected dataset that includes general stock images, e - commerce, gaming, and advertising content, it's suitable for large - scale enterprise content creation in commercial use cases. Its accuracy, efficiency, and versatility rival leading source - available models. It's an ideal choice when content safety, legally - licensed datasets, and bias mitigation are crucial.
Developed by BRIA AI, RMBG v1.4 is a source - available model for non - commercial use. To purchase a commercial license, click Here.
CLICK HERE FOR A DEMO
NOTE A new RMBG version is available! Check out RMBG - 2.0
Join our Discord community for more information, tutorials, tools, and to connect with other users!

๐ Quick Start
RMBG v1.4 is a powerful background removal model developed by BRIA AI. You can either purchase a commercial license or use it for non - commercial purposes. For detailed usage, please refer to the following sections.
โจ Features
- High - quality Performance: Trained on a large - scale professional dataset, it offers high accuracy and efficiency.
- Versatility: Suitable for various image types and categories, including general stock images, e - commerce, gaming, and advertising.
- Content Safety: Ideal for scenarios where content safety, legally - licensed datasets, and bias mitigation are important.
๐ฆ Installation
pip install -qr https://huggingface.co/briaai/RMBG-1.4/resolve/main/requirements.txt
๐ป Usage Examples
Basic Usage
Load the pipeline:
from transformers import pipeline
image_path = "https://farm5.staticflickr.com/4007/4322154488_997e69e4cf_z.jpg"
pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)
pillow_mask = pipe(image_path, return_mask = True)
pillow_image = pipe(image_path)
Advanced Usage
Load the model:
from transformers import AutoModelForImageSegmentation
from torchvision.transforms.functional import normalize
model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-1.4",trust_remote_code=True)
def preprocess_image(im: np.ndarray, model_input_size: list) -> torch.Tensor:
if len(im.shape) < 3:
im = im[:, :, np.newaxis]
im_tensor = torch.tensor(im, dtype=torch.float32).permute(2,0,1)
im_tensor = F.interpolate(torch.unsqueeze(im_tensor,0), size=model_input_size, mode='bilinear')
image = torch.divide(im_tensor,255.0)
image = normalize(image,[0.5,0.5,0.5],[1.0,1.0,1.0])
return image
def postprocess_image(result: torch.Tensor, im_size: list)-> np.ndarray:
result = torch.squeeze(F.interpolate(result, size=im_size, mode='bilinear') ,0)
ma = torch.max(result)
mi = torch.min(result)
result = (result-mi)/(ma-mi)
im_array = (result*255).permute(1,2,0).cpu().data.numpy().astype(np.uint8)
im_array = np.squeeze(im_array)
return im_array
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model.to(device)
image_path = "https://farm5.staticflickr.com/4007/4322154488_997e69e4cf_z.jpg"
orig_im = io.imread(image_path)
orig_im_size = orig_im.shape[0:2]
image = preprocess_image(orig_im, model_input_size).to(device)
result=model(image)
result_image = postprocess_image(result[0][0], orig_im_size)
pil_mask_im = Image.fromarray(result_image)
orig_image = Image.open(image_path)
no_bg_image = orig_image.copy()
no_bg_image.putalpha(pil_mask_im)
๐ Documentation
Model Description
Property |
Details |
Developed by |
BRIA AI |
Model Type |
Background Removal |
License |
[bria - rmbg - 1.4](https://bria.ai/bria - huggingface - model - license - agreement/). The model is released under a Creative Commons license for non - commercial use. Commercial use is subject to a commercial agreement with BRIA. To purchase a commercial license, click Here. |
Model Description |
BRIA RMBG 1.4 is a saliency segmentation model trained exclusively on a professional - grade dataset. |
BRIA |
Resources for more information: BRIA AI |
Training data
The Bria - RMBG model was trained with over 12,000 high - quality, high - resolution, manually - labeled (pixel - wise accuracy), fully - licensed images. The benchmark included balanced gender, balanced ethnicity, and people with different types of disabilities. The following shows the data distribution according to different categories:
Distribution of images:
Category |
Distribution |
Objects only |
45.11% |
People with objects/animals |
25.24% |
People only |
17.35% |
people/objects/animals with text |
8.52% |
Text only |
2.52% |
Animals only |
1.89% |
Category |
Distribution |
Photorealistic |
87.70% |
Non - Photorealistic |
12.30% |
Category |
Distribution |
Non Solid Background |
52.05% |
Solid Background |
47.95% |
Category |
Distribution |
Single main foreground object |
51.42% |
Multiple objects in the foreground |
48.58% |
Qualitative Evaluation

Architecture
RMBG v1.4 is developed on the IS - Net enhanced with a unique training scheme and a proprietary dataset. These modifications significantly improve the modelโs accuracy and effectiveness in diverse image - processing scenarios.
๐ License
The model is released under the [bria - rmbg - 1.4](https://bria.ai/bria - huggingface - model - license - agreement/) license. It's for non - commercial use under a Creative Commons license. For commercial use, a commercial agreement with BRIA is required. Click Here to purchase a commercial license.