VRMBG-3.0 improves both temporal consistency and per-frame accuracy over VRMBG-2.0 while maintaining a lightweight design that enables
real-time
video background removal. The model achieves an attractive trade-off between efficiency and state-of-the-art performance — both in matte quality and in temporal stability — and was carefully trained on a proprietary video dataset spanning a diverse range of settings, subjects, and scene conditions.
For still-image background removal, see RMBG-2.0.
Model Details
Developed by:
BRIA AI
Model type:
Video background removal / alpha matting
Parameters:
~220M
Inference resolution:
1024 × 1024
Input:
Current RGB video frame, paired with the previous frame's RGB multiplied by the previous frame's predicted alpha matte
Output:
Single-channel alpha matte for the current frame, in the range
[0, 1]
Latency:
Real-time inference
License:
BRIA VRMBG-3.0 License — non-commercial use only. Commercial use requires a commercial agreement with BRIA AI.
How it works
VRMBG-3.0 is
autoregressive
along the time axis. At each step the model consumes the current RGB frame together with the previous frame's RGB masked by the previous frame's predicted alpha, and emits the alpha matte for the current frame:
α_t = VRMBG3(RGB_t, RGB_{t-1} · α_{t-1})
For the first frame of a clip (no temporal prior), zero tensors are passed for both the previous-frame RGB and the previous-frame alpha. Conditioning on the previous frame's masked foreground provides a strong temporal prior that stabilises matte boundaries across frames and substantially reduces flicker compared with per-frame inference.
Inference
Minimal example
import torch
import numpy as np
import cv2
from torchvision import transforms
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from model import build_vrmbg3
# 1. Load the model
model = build_vrmbg3()
weights = hf_hub_download(repo_id="briaai/VRMBG-3.0", filename="model.safetensors")
model.load_state_dict(load_file(weights))
model = model.eval().half().cuda()
# 2. Pre-processing.
INFER_SIZE = 1024
normalize = transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
to_tensor = transforms.ToTensor()
device = torch.device("cuda")
dtype = next(model.parameters()).dtype # likely torch.float16# 3. Initialise temporal state with zeros for the first frame.
prev_rgb_t = torch.zeros(3, INFER_SIZE, INFER_SIZE, device=device, dtype=dtype)
prev_alpha = torch.zeros(1, INFER_SIZE, INFER_SIZE, device=device, dtype=dtype)
cap = cv2.VideoCapture("input.mp4")
mattes = []
whileTrue:
ok, bgr = cap.read()
ifnot ok:
break
rgb = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)
h, w = rgb.shape[:2]
rgb_resized = cv2.resize(rgb, (INFER_SIZE, INFER_SIZE), interpolation=cv2.INTER_LINEAR)
current_t = normalize(to_tensor(rgb_resized)).to(device=device, dtype=dtype)
# Build the paired input: [current RGB, previous RGB * previous alpha].
paired = torch.cat([current_t, prev_rgb_t * prev_alpha], dim=0).unsqueeze(0)
paired = paired.contiguous(memory_format=torch.channels_last)
with torch.no_grad():
pred = model(paired)[-1].sigmoid().squeeze(0) # (1, H, W) in [0, 1]# Resize the matte back to native resolution.
alpha_native = cv2.resize(
pred[0].float().cpu().numpy(), (w, h), interpolation=cv2.INTER_LINEAR
)
mattes.append(alpha_native)
# Update temporal state for the next frame.
prev_rgb_t = current_t
prev_alpha = pred
cap.release()
Intended Use
Real-time video background removal for production content (people, objects, products) where temporal stability matters.
Autoregressive inference along the time axis: the model consumes the current frame together with the previous frame's predicted alpha at each step.
For still-image background removal, use RMBG-2.0.
Files
File
Description
model.py
Model architecture — import this to instantiate the network
model.safetensors
Trained weights in safetensors format, 885 MB
pytorch_model.bin
Same weights as a PyTorch
state_dict
README.md
This model card
License
Released under the BRIA VRMBG-3.0 License. This model is not open source at the moment. Commercial use is subject to a commercial agreement with BRIA AI — please contact the BRIA team to request access or arrange a commercial agreement.
Runs of briaai VRMBG-3.0 on huggingface.co
211
Total runs
-2
24-hour runs
3
3-day runs
-3
7-day runs
126
30-day runs
More Information About VRMBG-3.0 huggingface.co Model
VRMBG-3.0 huggingface.co is an AI model on huggingface.co that provides VRMBG-3.0's model effect (), which can be used instantly with this briaai VRMBG-3.0 model. huggingface.co supports a free trial of the VRMBG-3.0 model, and also provides paid use of the VRMBG-3.0. Support call VRMBG-3.0 model through api, including Node.js, Python, http.
VRMBG-3.0 huggingface.co is an online trial and call api platform, which integrates VRMBG-3.0's modeling effects, including api services, and provides a free online trial of VRMBG-3.0, you can try VRMBG-3.0 online for free by clicking the link below.
briaai VRMBG-3.0 online free url in huggingface.co:
VRMBG-3.0 is an open source model from GitHub that offers a free installation service, and any user can find VRMBG-3.0 on GitHub to install. At the same time, huggingface.co provides the effect of VRMBG-3.0 install, users can directly use VRMBG-3.0 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.