File size: 1,274 Bytes
f4ec5b0
 
 
 
45a7bec
f4ec5b0
19cccb6
 
0f0fe2f
7d1b6e1
 
 
dc4f604
7d1b6e1
 
 
dc4f604
7d1b6e1
 
dc4f604
 
 
 
2cd441b
dc4f604
7d1b6e1
dc4f604
7d1b6e1
 
 
dc4f604
 
3388311
f4ec5b0
 
6b1c941
 
 
 
 
 
 
 
 
 
 
 
 
 
066b9a1
6b1c941
 
 
 
 
f4ec5b0
 
 
 
 
 
 
 
6b1c941
 
f4ec5b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
license: apache-2.0
---

# BEN - Background Erase Network (Beta Base Model)

BEN is a deep learning model designed to automatically remove backgrounds from images, producing both a mask and a foreground image. 

- MADE IN AMERICA

## Quick Start Code
```python
from BEN import model
from PIL import Image
import torch


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

file = "./image2.jpg" # input image

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

model.loadcheckpoints("./BEN/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.0283
- DICE: 0.8976
- IOU: 0.8430
- BER: 0.0542
- ACC: 0.9725

### BEN_Base:
- MAE: 0.0331
- DICE: 0.8743
- IOU: 0.8301
- BER: 0.0560
- ACC: 0.9700

### MVANet (old SOTA):
- MAE: 0.0353
- DICE: 0.8676
- IOU: 0.8104
- BER: 0.0639
- ACC: 0.9660

## 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