PramaLLC/BEN3

BEN3 open-source version (MIT) uploaded by Prama LLC (BackgroundErase) on 1 12: Uses a DINOv3 ViT-B/16 encoder with a DPT-style decoder, generating 3 candidate masks per image, from which a scoring head selects the best one. It outputs a foreground RGBA image and a 8-bit alpha mask, with a default inference size of 1024×1024. Supports single images, batch images, and frame-by-frame video processing. Videos can be exported as transparent VP9 WebM (with optional audio track preservation) or MP4 with a solid color background.

BEN3 open-source version (MIT) uploaded by Prama LLC (BackgroundErase) on 1 12: Uses a DINOv3 ViT-B/16 encoder with a DPT-style decoder, generating 3 candidate masks per image, from which a scoring head selects the best one. It outputs a foreground RGBA image and a 8-bit alpha mask, with a default inference size of 1024×1024. Supports single images, batch images, and frame-by-frame video processing. Videos can be exported as transparent VP9 WebM (with optional audio track preservation) or MP4 with a solid color background.

Why it matters Remove backgrounds from single images, batches, and entire videos with a single line of code. Directly export transparent videos or videos with solid color backgrounds. MIT licensed.

Rising score 94 · Likes 125 · Downloads 201

Reasons

  • Author-provided DIS-TE (2,000 images) results: The full multi-hypothesis fusion framework MHFNet achieves a weighted F-measure of 0.905 and MAE of 0.026, outperforming BiRefNet (0.858), MVANet (0.861, and DiffDIS (0.892) in the table; fusion improves the weighted F-measure from 0.8915 to 0.9054 compared to selecting a single candidate.
  • Simple interface: After loading with BEN3.from_pretrained, model.inference directly returns the foreground and mask; passing a list enables batch processing; segment_video handles entire videos with a single function.
  • Training data consists of approximately 38,000 images owned by the authors (not publicly released); the model card includes image effect collages and video demos, with an online Space available on Hugging Face.

Usage

  • pip install git+https://github.com/PramaLLC/BEN3.git;from ben3 import BEN3; model = BEN3.from_pretrained("PramaLLC/BEN3", device="cuda"); foreground, mask = model.inference(Image.open("input.jpg"))
  • Video: model.segment_video("input.mp4", output_path="foreground.webm", batch=8, webm=True, add_audio=True) produces a transparent video; use rgb_value=(255, 255, 255) and .mp4 output for a white-background video; requires ffmpeg and ffprobe installation.

Risks

  • The benchmarks in the model card belong to the MHFNet research framework; the authors explicitly state this is not the open-source generator in this repository. The full version with the second-stage fusion network is only available via the official website, API, and commercial licensing. The open-source version's performance has not been independently evaluated.
  • The model card promotes a commercial API; there are no ComfyUI nodes, and VRAM requirements are not specified; this entry has not been run.

Open

Hugging Face Trending

Explore the latest AI Radar updates