Max Meyer
commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,23 @@ license: apache-2.0
|
|
| 6 |
|
| 7 |
BEN is a deep learning model designed to automatically remove backgrounds from images, producing both a mask and a foreground image.
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# BEN SOA Benchmarks on Disk 5k Eval
|
| 10 |
|
| 11 |
### BEN_Base + BEN_Refiner (commercial model please contact us for more information):
|
|
@@ -39,17 +56,3 @@ BEN is a deep learning model designed to automatically remove backgrounds from i
|
|
| 39 |
1. Clone Repo
|
| 40 |
2. Install requirements.txt
|
| 41 |
|
| 42 |
-
## Quick Start Code
|
| 43 |
-
```python
|
| 44 |
-
from BEN import BEN_Base
|
| 45 |
-
from PIL import Image
|
| 46 |
-
import torch
|
| 47 |
-
|
| 48 |
-
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 49 |
-
model = BEN_Base().to(device).eval()
|
| 50 |
-
model.loadcheckpoints("./BEN/BEN_Base.pth")
|
| 51 |
-
|
| 52 |
-
image = Image.open("./image2.jpg")
|
| 53 |
-
mask, foreground = model.inference(image)
|
| 54 |
-
mask.save("./mask.png")
|
| 55 |
-
foreground.save("./foreground.png")
|
|
|
|
| 6 |
|
| 7 |
BEN is a deep learning model designed to automatically remove backgrounds from images, producing both a mask and a foreground image.
|
| 8 |
|
| 9 |
+
|
| 10 |
+
## Quick Start Code
|
| 11 |
+
```python
|
| 12 |
+
from BEN import BEN_Base
|
| 13 |
+
from PIL import Image
|
| 14 |
+
import torch
|
| 15 |
+
|
| 16 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 17 |
+
model = BEN_Base().to(device).eval()
|
| 18 |
+
model.loadcheckpoints("./BEN/BEN_Base.pth")
|
| 19 |
+
|
| 20 |
+
image = Image.open("./image2.jpg")
|
| 21 |
+
mask, foreground = model.inference(image)
|
| 22 |
+
mask.save("./mask.png")
|
| 23 |
+
foreground.save("./foreground.png")
|
| 24 |
+
|
| 25 |
+
|
| 26 |
# BEN SOA Benchmarks on Disk 5k Eval
|
| 27 |
|
| 28 |
### BEN_Base + BEN_Refiner (commercial model please contact us for more information):
|
|
|
|
| 56 |
1. Clone Repo
|
| 57 |
2. Install requirements.txt
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|