Instructions to use nobg/BiRefNet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use nobg/BiRefNet with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("nobg/BiRefNet", trust_remote_code=True)# Option 2: use with BiRefNet # Install from https://github.com/ZhengPeng7/BiRefNet from models.birefnet import BiRefNet model = BiRefNet.from_pretrained("nobg/BiRefNet") - Notebooks
- Google Colab
- Kaggle
Refactor: transformers SwinBackbone layout, num_layers/nobg_version config, from_origin, hot-swappable criterion, paper_url card (weights remapped, metric-identical)
Browse files- README.md +14 -0
- config.json +25 -23
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -31,5 +31,19 @@ from nobg import BiRefNet
|
|
| 31 |
model = BiRefNet.from_pretrained("nobg/BiRefNet")
|
| 32 |
```
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
## Contributions
|
| 35 |
Any contributions are welcome at https://github.com/feyninc/nobg
|
|
|
|
| 31 |
model = BiRefNet.from_pretrained("nobg/BiRefNet")
|
| 32 |
```
|
| 33 |
|
| 34 |
+
|
| 35 |
+
## Citation
|
| 36 |
+
If you use this model, please cite the original paper
|
| 37 |
+
(https://arxiv.org/abs/2401.03407):
|
| 38 |
+
```bibtex
|
| 39 |
+
@article{zheng2024birefnet,
|
| 40 |
+
title={Bilateral Reference for High-Resolution Dichotomous Image Segmentation},
|
| 41 |
+
author={Zheng, Peng and Gao, Dehong and Fan, Deng-Ping and Liu, Li and
|
| 42 |
+
Laaksonen, Jorma and Ouyang, Wanli and Sebe, Nicu},
|
| 43 |
+
journal={CAAI Artificial Intelligence Research},
|
| 44 |
+
year={2024}
|
| 45 |
+
}
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
## Contributions
|
| 49 |
Any contributions are welcome at https://github.com/feyninc/nobg
|
config.json
CHANGED
|
@@ -1,24 +1,26 @@
|
|
| 1 |
-
{
|
| 2 |
-
"dec_channels_inter": 64,
|
| 3 |
-
"depths": [
|
| 4 |
-
2,
|
| 5 |
-
2,
|
| 6 |
-
18,
|
| 7 |
-
2
|
| 8 |
-
],
|
| 9 |
-
"drop_path_rate": 0.2,
|
| 10 |
-
"embed_dim": 192,
|
| 11 |
-
"image_size": 1024,
|
| 12 |
-
"mlp_ratio": 4.0,
|
| 13 |
-
"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
"
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"
|
|
|
|
|
|
|
| 24 |
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dec_channels_inter": 64,
|
| 3 |
+
"depths": [
|
| 4 |
+
2,
|
| 5 |
+
2,
|
| 6 |
+
18,
|
| 7 |
+
2
|
| 8 |
+
],
|
| 9 |
+
"drop_path_rate": 0.2,
|
| 10 |
+
"embed_dim": 192,
|
| 11 |
+
"image_size": 1024,
|
| 12 |
+
"mlp_ratio": 4.0,
|
| 13 |
+
"nobg_version": "0.2.0",
|
| 14 |
+
"num_heads": [
|
| 15 |
+
6,
|
| 16 |
+
12,
|
| 17 |
+
24,
|
| 18 |
+
48
|
| 19 |
+
],
|
| 20 |
+
"num_layers": 4,
|
| 21 |
+
"patch_size": 4,
|
| 22 |
+
"use_gradient_attention": true,
|
| 23 |
+
"use_image_patch_injection": true,
|
| 24 |
+
"use_multi_scale_input": true,
|
| 25 |
+
"window_size": 12
|
| 26 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d5af44e605ec7bab2e532957db88b89126c25e887f700515756348e3bf647cb
|
| 3 |
+
size 880926192
|