From: PramaLLC <huggingface.co/PramaLLC>Newsgroups: alt.freeweights.visionSubject:

BEN2

Date: 2026-11-15Commit: e48a207Signed: 2DC28CC7B26A283B ✓

Image segmentation model with 95M parameters. Onnx and safetensors weights, 1.76 GB in all. Published by PramaLLC under MIT.

95M params1.76GBBEN2onnx safetensorspermissive
FactsParams95MSize1.76 GBFormatsonnx, safetensorsTaskimage segmentationLicenseMITFrom sourcepermissive
$ fw get PramaLLC/BEN2
# manifest sha256 6caca6054170… · 1.76 GB · 16 files
$ fw verify ./BEN2 PramaLLC/BEN2
From sourceHosted (signed)PramaLLC/BEN2Last check: 2026-11-15 02:29 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
1.76 GB
Weights
381 MB (safetensors)
Parameters
95M
Formats
onnx, safetensors
Task
image segmentation
License
MIT (permissive)
Files
16, each with a sha256
Publisher
PramaLLC
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:29 UTCpassed

Model card

From the publisher at commit e48a207. Shown as plain text with links; images open at the publisher.

BEN2: Background Erase Network#

arXiv GitHub Website

Overview#

BEN2 (Background Erase Network) introduces a novel approach to foreground segmentation through its innovative Confidence Guided Matting (CGM) pipeline. The architecture employs a refiner network that targets and processes pixels where the base model exhibits lower confidence levels, resulting in more precise and reliable matting results. This model is built on BEN: PWC

BEN2 access#

BEN2 was trained on the DIS5k and our 22K proprietary segmentation dataset. Our enhanced model delivers superior performance in hair matting, 4K processing, object segmentation, and edge refinement. Our Base model is open source. To try the full model through our free web demo or integrate BEN2 into your project with our API:

Contact us#

Installation#

pip install -e "git+https://github.com/PramaLLC/BEN2.git#egg=ben2"

Quick start code#

from ben2 import BEN_Base
from PIL import Image
import torch


device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

file = "./image.png" # input image

model = BEN_Base.from_pretrained("PramaLLC/BEN2")
model.to(device).eval()

image = Image.open(file)
foreground = model.inference(image, refine_foreground=False,) #Refine foreground is an extract postprocessing step that increases inference time but can improve matting edges. The default value is False.

foreground.save("./foreground.png")

Batch image processing#

from ben2 import BEN_Base
from PIL import Image
import torch


device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')



model = BEN_Base.from_pretrained("PramaLLC/BEN2")
model.to(device).eval()


file1 = "./image1.png" # input image1
file2 = "./image2.png" # input image2
image1 = Image.open(file1)
image2 = Image.open(file2)



foregrounds = model.inference([image1, image2]) #  We recommend that the batch size not exceed 3 for consumer GPUs as there are minimal inference gains due to our custom batch processing for the MVANet decoding steps.
foregrounds[0].save("./foreground1.png")
foregrounds[1].save("./foreground2.png")

BEN2 video segmentation#

BEN2 Demo

Video Segmentation#

sudo apt update
sudo apt install ffmpeg
from ben2 import BEN_Base
from PIL import Image
import torch


device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

video_path = "/path_to_your_video.mp4"# input video

model = BEN_Base.from_pretrained("PramaLLC/BEN2")
model.to(device).eval()


model.segment_video(
    video_path= video_path,
    output_path="./", # Outputs will be saved as foreground.webm or foreground.mp4. The default value is "./"
    fps=0, # If this is set to 0 CV2 will detect the fps in the original video. The default value is 0.
    refine_foreground=False,  #refine foreground is an extract postprocessing step that increases inference time but can improve matting edges. The default value is False.
    batch=1,  # We recommended that batch size not exceed 3 for consumer GPUs as there are minimal inference gains. The default value is 1.
    print_frames_processed=True,  #Informs you what frame is being processed. The default value is True.
    webm = False, # This will output an alpha layer video but this defaults to mp4 when webm is false. The default value is False.
    rgb_value= (0, 255, 0) # If you do not use webm this will be the RGB value of the resulting background only when webm is False. The default value is a green background (0,255,0).
 )

# BEN2 evaluation Image: Model Comparison

RMBG 2.0 did not preserve the DIS 5k validation dataset

Image: Example 1 Image: Example 2 Image: Example 3 Image: Example 6 Image: Example 7

Files

16 files · 1.76 GBWeights 381 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 16 files with their sha256
FileSizesha256
.gitattributes1.96 KB2e33c0eb1258a53231fed2a101e475601f3fabe45202f6e2fe68b87a39698599
BEN2.py53.5 KB16e6132faefc112ea97072b93df40c847a33aad7c04a2e578b417e9ebb6094a7
BEN2_Base.onnx223 MB22cea62108ff53b7ccc20f7a008bf30494228d84b1687f29ecbe76936a998101
BEN2_Base.pth1.13 GB926144a876bda06f125555b4f5a239ece89dc6eb838a863700ca9bf192161a1c
BEN2_demo_pictures/grid_example1.png1.51 MB49df5808df57c1db87f1bdf94ff0687ba436f2c377378799dd3ce49be85e0973
BEN2_demo_pictures/grid_example2.png1.76 MB0899c57bdb592ccf3b04ed0316d3f8d4b23f337ff00f6807b18b46b74b8e91bf
BEN2_demo_pictures/grid_example3.png8.59 MBf0e2cb53afd4ad04daa223525f688cad835826890eb4ababb1e0bf0e629800e5
BEN2_demo_pictures/grid_example6.png2.37 MB327eca743beef0cd452e40015b0695d67806cd6b59bd3a7759cfd2be260c5cae
BEN2_demo_pictures/grid_example7.png5.27 MB0f758d617b3266d2fb540bd5088c58a3a69d1cb5e54dcdf0a4d5ea6b74c6e7e2
BEN2_demo_pictures/model_comparison.png328 KBb7b666c9f0b2c40fa471c21a3eeb6ff34f045082b3253d05392c7c58caff8621
README.md5.13 KBe4dcb23dcc566e37c4e9140514a84fbe1ae6607db48ac9d1b4113bb89f124d7d
config.json124 B01ac876925577b52fa7c6af3f5b1d1420bc9b40016b6c25e2de89b38d8fff865
inference.py353 B60c125aa6f0acdccc10eb02b153208cf4e8261971c86965080843f2f3ea66614
model.safetensors381 MBea8b7907176a09667c86343dc7d00de6a6d871076cb90bb5f753618fd6fb3ebb
onnx_run.py1.68 KB558d7eda04d7c24eb42377e16047bc024260e024ec22b9550f82a6095af2b71f
requirements.txt102 B5742ec258748a74cc0874de02a07378738980fbec343c8edbd320d4d6b8c094b
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
e48a20765f pinned now2026-11-15 02:29 UTC16 files · 1.76 GB

Use it

$ fw get PramaLLC/BEN2
# manifest sha256 6caca6054170… · 1.76 GB · 16 files
$ fw verify ./BEN2 PramaLLC/BEN2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/PramaLLC/BEN2.json --dir ./BEN2 $ python3 fw.py verify ./BEN2 ./PramaLLC__BEN2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download PramaLLC/BEN2 --revision e48a20765fb421d19dcdb0bf3cc61e802ca5ec8f --local-dir ./BEN2

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
e4dcb23dcc566e37c4e9140514a84fbe1ae6607db48ac9d1b4113bb89f124d7d
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: PramaLLC <huggingface.co/PramaLLC>Newsgroups: alt.freeweights.visionSubject: BEN2Date: 2026-11-15Commit: e48a207Signed: 2DC28CC7B26A283B ✓
Upstream
PramaLLC/BEN2
Pinned commit
e48a20765fb421d19dcdb0bf3cc61e802ca5ec8f
Manifest
BEN2.json · .minisig
Manifest sha256
6caca60541704ce6371dfd7f7463a37c8fa2dbe8e19ac60d6b4c691d76f5dedb
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:29 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/PramaLLC/BEN2.json $ curl -O https://freeweights.allternit.com/manifests/PramaLLC/BEN2.json.minisig $ minisign -Vm BEN2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Quantizations 1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download PramaLLC/BEN2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. BEN2.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of BEN2. Each has its own license check and page.

From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX