Max Meyer
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,66 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
|
6 |
+
# BEN - Background Erase Network
|
7 |
+
|
8 |
+
BEN is a deep learning model designed to automatically remove backgrounds from images, producing both a mask and a foreground image.
|
9 |
+
|
10 |
+
|
11 |
+
# BEN SOA Benchmarks on Disk 5k Eval
|
12 |
+
|
13 |
+
BEN_Base + BEN_Refiner (commerical model please contanct us for more information):
|
14 |
+
MAE-0.0283
|
15 |
+
DICE-0.8976
|
16 |
+
IOU-0.8430
|
17 |
+
BER-0.0542
|
18 |
+
ACC-0.9725
|
19 |
+
|
20 |
+
|
21 |
+
BEN_Base:
|
22 |
+
MAE-0.0331
|
23 |
+
DICE-0.8743
|
24 |
+
IOU-0.8301
|
25 |
+
BER-0.0560
|
26 |
+
ACC-0.9700
|
27 |
+
|
28 |
+
MVANet (old SOA):
|
29 |
+
MAE-0.0353
|
30 |
+
DICE-0.8676
|
31 |
+
IOU-0.8104
|
32 |
+
BER-0.0639
|
33 |
+
ACC-0.9660
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
## Features
|
40 |
+
|
41 |
+
- Background removal from images
|
42 |
+
- Generates both binary mask and foreground image
|
43 |
+
- CUDA support for GPU acceleration
|
44 |
+
- Simple API for easy integration
|
45 |
+
|
46 |
+
## Installation
|
47 |
+
- Clone Repo
|
48 |
+
- Install requirements.txt
|
49 |
+
|
50 |
+
## Quick Start Code
|
51 |
+
from BEN import BEN_Base
|
52 |
+
from PIL import Image
|
53 |
+
import torch
|
54 |
+
|
55 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
56 |
+
|
57 |
+
|
58 |
+
model = BEN_Base().to(device).eval()
|
59 |
+
model.loadcheckpoints("./BEN/BEN_Base.pth")
|
60 |
+
|
61 |
+
image = Image.open("./image2.jpg")
|
62 |
+
mask, foreground = model.inference(image)
|
63 |
+
|
64 |
+
mask.save("./mask.png")
|
65 |
+
foreground.save("./foreground.png")
|
66 |
+
|