Update README.md
Browse files
README.md
CHANGED
@@ -1,112 +1,90 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
pipeline_tag: image-segmentation
|
4 |
-
tags:
|
5 |
-
- BEN
|
6 |
-
- background-remove
|
7 |
-
- mask-generation
|
8 |
-
- Dichotomous image segmentation
|
9 |
-
- background remove
|
10 |
-
- foreground
|
11 |
-
- background
|
12 |
-
- remove background
|
13 |
-
- pytorch
|
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 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
###
|
74 |
-
- MAE: 0.
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
-
|
84 |
-
-
|
85 |
-
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
- BER: 0.0639
|
92 |
-
- ACC: 0.9660
|
93 |
-
|
94 |
-
|
95 |
-
### BiRefNet(not tested in house):
|
96 |
-
- MAE: 0.038
|
97 |
-
|
98 |
-
|
99 |
-
### InSPyReNet (not tested in house):
|
100 |
-
- MAE: 0.042
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
## Features
|
105 |
-
- Background removal from images
|
106 |
-
- Generates both binary mask and foreground image
|
107 |
-
- CUDA support for GPU acceleration
|
108 |
-
- Simple API for easy integration
|
109 |
-
|
110 |
-
## Installation
|
111 |
-
1. Clone Repo
|
112 |
-
2. Install requirements.txt
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
pipeline_tag: image-segmentation
|
4 |
+
tags:
|
5 |
+
- BEN
|
6 |
+
- background-remove
|
7 |
+
- mask-generation
|
8 |
+
- Dichotomous image segmentation
|
9 |
+
- background remove
|
10 |
+
- foreground
|
11 |
+
- background
|
12 |
+
- remove background
|
13 |
+
- pytorch
|
14 |
+
---
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
## Model Provided by ParmaLLC
|
19 |
+
The base model is publicly available and free to use for commercial use on HuggingFace:
|
20 |
+
- 🤗 [PramaLLC/BEN](https://huggingface.co/PramaLLC/BEN)
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
## Quick Start Code (Inside Cloned Repo)
|
25 |
+
|
26 |
+
```python
|
27 |
+
import model
|
28 |
+
from PIL import Image
|
29 |
+
import torch
|
30 |
+
|
31 |
+
|
32 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
33 |
+
|
34 |
+
file = "./image.png" # input image
|
35 |
+
|
36 |
+
model = model.BEN_Base().to(device).eval() #init pipeline
|
37 |
+
|
38 |
+
model.loadcheckpoints("./BEN_Base.pth")
|
39 |
+
image = Image.open(file)
|
40 |
+
mask, foreground = model.inference(image)
|
41 |
+
|
42 |
+
mask.save("./mask.png")
|
43 |
+
foreground.save("./foreground.png")
|
44 |
+
```
|
45 |
+
|
46 |
+
# BEN SOA Benchmarks on Disk 5k Eval
|
47 |
+
|
48 |
+

|
49 |
+
|
50 |
+
|
51 |
+
### BEN_Base + BEN_Refiner (commercial model please contact us for more information):
|
52 |
+
- MAE: 0.0270
|
53 |
+
- DICE: 0.8989
|
54 |
+
- IOU: 0.8506
|
55 |
+
- BER: 0.0496
|
56 |
+
- ACC: 0.9740
|
57 |
+
|
58 |
+
### BEN_Base (94 million parameters):
|
59 |
+
- MAE: 0.0309
|
60 |
+
- DICE: 0.8806
|
61 |
+
- IOU: 0.8371
|
62 |
+
- BER: 0.0516
|
63 |
+
- ACC: 0.9718
|
64 |
+
|
65 |
+
### MVANet (old SOTA):
|
66 |
+
- MAE: 0.0353
|
67 |
+
- DICE: 0.8676
|
68 |
+
- IOU: 0.8104
|
69 |
+
- BER: 0.0639
|
70 |
+
- ACC: 0.9660
|
71 |
+
|
72 |
+
|
73 |
+
### BiRefNet(not tested in house):
|
74 |
+
- MAE: 0.038
|
75 |
+
|
76 |
+
|
77 |
+
### InSPyReNet (not tested in house):
|
78 |
+
- MAE: 0.042
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
## Features
|
83 |
+
- Background removal from images
|
84 |
+
- Generates both binary mask and foreground image
|
85 |
+
- CUDA support for GPU acceleration
|
86 |
+
- Simple API for easy integration
|
87 |
+
|
88 |
+
## Installation
|
89 |
+
1. Clone Repo
|
90 |
+
2. Install requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|