🤗 Hugging Face 来源image-segmentationapache-2.02.9 GBother✓ 3 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo PramaLLC/BEN ./model-folder
需要做种者 →

BEN: Background Erase Network

Overview

BEN (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 repository provides the official code for our model, as detailed in our research paper: BEN: Background Erase Network.

BEN2 Access

BEN2 is now publicly available, trained on DIS5k and our 22K proprietary segmentation dataset. Our enhanced model delivers superior performance in hair matting, 4K processing, object segmentation, and edge refinement. Access the base model on Huggingface, try the full model through our free web demo or integrate BEN2 into your project with our API:

Model Access

The base model is publicly available and free to use for commercial use on HuggingFace:

Contact US

Quick Start Code (Inside Cloned Repo)

import model
from PIL import Image
import torch


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

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

model = model.BEN_Base().to(device).eval() #init pipeline

model.loadcheckpoints("./BEN_Base.pth")
image = Image.open(file)
mask, foreground = model.inference(image)

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

BEN SOA Benchmarks on Disk 5k Eval

BEN_Base + BEN_Refiner (commercial model please contact us for more information):

  • MAE: 0.0270
  • DICE: 0.8989
  • IOU: 0.8506
  • BER: 0.0496
  • ACC: 0.9740

BEN_Base (94 million parameters):

  • MAE: 0.0309
  • DICE: 0.8806
  • IOU: 0.8371
  • BER: 0.0516
  • ACC: 0.9718

MVANet (old SOTA):

  • MAE: 0.0353
  • DICE: 0.8676
  • IOU: 0.8104
  • BER: 0.0639
  • ACC: 0.9660

BiRefNet(not tested in house):

  • MAE: 0.038

InSPyReNet (not tested in house):

  • MAE: 0.042

Features

  • Background removal from images
  • Generates both binary mask and foreground image
  • CUDA support for GPU acceleration
  • Simple API for easy integration

Installation

  1. Clone Repo
  2. Install requirements.txt