schirrmacher
commited on
Commit
•
8869360
1
Parent(s):
04566b4
Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- README.md +6 -1
- examples/example1.png +3 -0
- examples/no-background1.png +3 -0
- utils/inference.py +4 -3
.gitattributes
CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
example.png filter=lfs diff=lfs merge=lfs -text
|
37 |
no-background.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
example.png filter=lfs diff=lfs merge=lfs -text
|
37 |
no-background.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
examples/example1.png filter=lfs diff=lfs merge=lfs -text
|
39 |
+
examples/no-background1.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -2,7 +2,10 @@
|
|
2 |
license: apache-2.0
|
3 |
tags:
|
4 |
- segmentation
|
5 |
-
- background
|
|
|
|
|
|
|
6 |
pretty_name: Open Remove Background Model
|
7 |
datasets:
|
8 |
- schirrmacher/humans
|
@@ -10,6 +13,8 @@ datasets:
|
|
10 |
|
11 |
# Open Remove Background Model (ormbg)
|
12 |
|
|
|
|
|
13 |
This model is a **fully open-source background remover** optimized for images with humans. It is based on [Highly Accurate Dichotomous Image Segmentation research](https://github.com/xuebinqin/DIS).
|
14 |
|
15 |
This model is similar to [RMBG-1.4](https://huggingface.co/briaai/RMBG-1.4), but with open training data/process and commercially free to use.
|
|
|
2 |
license: apache-2.0
|
3 |
tags:
|
4 |
- segmentation
|
5 |
+
- remove background
|
6 |
+
- background
|
7 |
+
- background-removal
|
8 |
+
- Pytorch
|
9 |
pretty_name: Open Remove Background Model
|
10 |
datasets:
|
11 |
- schirrmacher/humans
|
|
|
13 |
|
14 |
# Open Remove Background Model (ormbg)
|
15 |
|
16 |
+
[>>> DEMO <<<](https://huggingface.co/spaces/schirrmacher/ormbg)
|
17 |
+
|
18 |
This model is a **fully open-source background remover** optimized for images with humans. It is based on [Highly Accurate Dichotomous Image Segmentation research](https://github.com/xuebinqin/DIS).
|
19 |
|
20 |
This model is similar to [RMBG-1.4](https://huggingface.co/briaai/RMBG-1.4), but with open training data/process and commercially free to use.
|
examples/example1.png
ADDED
Git LFS Details
|
examples/no-background1.png
ADDED
Git LFS Details
|
utils/inference.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import torch
|
2 |
import argparse
|
3 |
import numpy as np
|
@@ -14,19 +15,19 @@ def parse_args():
|
|
14 |
parser.add_argument(
|
15 |
"--input",
|
16 |
type=str,
|
17 |
-
default="
|
18 |
help="Path to the input image file.",
|
19 |
)
|
20 |
parser.add_argument(
|
21 |
"--output",
|
22 |
type=str,
|
23 |
-
default="no-
|
24 |
help="Path to the output image file.",
|
25 |
)
|
26 |
parser.add_argument(
|
27 |
"--model-path",
|
28 |
type=str,
|
29 |
-
default="models
|
30 |
help="Path to the model file.",
|
31 |
)
|
32 |
return parser.parse_args()
|
|
|
1 |
+
import os
|
2 |
import torch
|
3 |
import argparse
|
4 |
import numpy as np
|
|
|
15 |
parser.add_argument(
|
16 |
"--input",
|
17 |
type=str,
|
18 |
+
default=os.path.join("examples", "example1.png"),
|
19 |
help="Path to the input image file.",
|
20 |
)
|
21 |
parser.add_argument(
|
22 |
"--output",
|
23 |
type=str,
|
24 |
+
default=os.path.join("examples", "no-background1.png"),
|
25 |
help="Path to the output image file.",
|
26 |
)
|
27 |
parser.add_argument(
|
28 |
"--model-path",
|
29 |
type=str,
|
30 |
+
default=os.path.join("models", "ormbg.pth"),
|
31 |
help="Path to the model file.",
|
32 |
)
|
33 |
return parser.parse_args()
|