Image Segmentation
BiRefNet
Safetensors
background-removal
mask-generation
Dichotomous Image Segmentation
Camouflaged Object Detection
Salient Object Detection
pytorch_model_hub_mixin
model_hub_mixin
custom_code
Instructions to use ZhengPeng7/BiRefNet_lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use ZhengPeng7/BiRefNet_lite with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("ZhengPeng7/BiRefNet_lite", 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("ZhengPeng7/BiRefNet_lite") - Notebooks
- Google Colab
- Kaggle
Rename BiRefNet_T to BiRefNet_lite.
Browse files
README.md
CHANGED
|
@@ -63,11 +63,11 @@ pip install -qr https://raw.githubusercontent.com/ZhengPeng7/BiRefNet/main/requi
|
|
| 63 |
```python
|
| 64 |
# Load BiRefNet with weights
|
| 65 |
from transformers import AutoModelForImageSegmentation
|
| 66 |
-
birefnet = AutoModelForImageSegmentation.from_pretrained('zhengpeng7/
|
| 67 |
```
|
| 68 |
|
| 69 |
#### Use codes from GitHub + weights from HuggingFace
|
| 70 |
-
> Only use the weights on HuggingFace -- Pro: codes are always latest; Con: Need to clone the BiRefNet repo from my GitHub.
|
| 71 |
|
| 72 |
```shell
|
| 73 |
# Download codes
|
|
@@ -81,7 +81,7 @@ from models.birefnet import BiRefNet
|
|
| 81 |
|
| 82 |
# Load weights from Hugging Face Models
|
| 83 |
### >>> Remember to set the `bb` in `config.py` as `swin_v1_t` to use this tiny version. <<< ###
|
| 84 |
-
birefnet = BiRefNet.from_pretrained('zhengpeng7/
|
| 85 |
```
|
| 86 |
|
| 87 |
#### Use codes from GitHub + weights from HuggingFace
|
|
|
|
| 63 |
```python
|
| 64 |
# Load BiRefNet with weights
|
| 65 |
from transformers import AutoModelForImageSegmentation
|
| 66 |
+
birefnet = AutoModelForImageSegmentation.from_pretrained('zhengpeng7/BiRefNet_lite', trust_remote_code=True)
|
| 67 |
```
|
| 68 |
|
| 69 |
#### Use codes from GitHub + weights from HuggingFace
|
| 70 |
+
> Only use the weights on HuggingFace -- Pro: codes are always the latest; Con: Need to clone the BiRefNet repo from my GitHub.
|
| 71 |
|
| 72 |
```shell
|
| 73 |
# Download codes
|
|
|
|
| 81 |
|
| 82 |
# Load weights from Hugging Face Models
|
| 83 |
### >>> Remember to set the `bb` in `config.py` as `swin_v1_t` to use this tiny version. <<< ###
|
| 84 |
+
birefnet = BiRefNet.from_pretrained('zhengpeng7/BiRefNet_lite')
|
| 85 |
```
|
| 86 |
|
| 87 |
#### Use codes from GitHub + weights from HuggingFace
|