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-2K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use ZhengPeng7/BiRefNet_lite-2K with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("ZhengPeng7/BiRefNet_lite-2K", 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-2K") - Notebooks
- Google Colab
- Kaggle
Fix the backbone setting for the lite version.
Browse files- birefnet.py +1 -1
birefnet.py
CHANGED
|
@@ -62,7 +62,7 @@ class Config():
|
|
| 62 |
'swin_v1_b', 'swin_v1_l', # 5-bs9, 6-bs4
|
| 63 |
'pvt_v2_b0', 'pvt_v2_b1', # 7, 8
|
| 64 |
'pvt_v2_b2', 'pvt_v2_b5', # 9-bs10, 10-bs5
|
| 65 |
-
][
|
| 66 |
self.lateral_channels_in_collection = {
|
| 67 |
'vgg16': [512, 256, 128, 64], 'vgg16bn': [512, 256, 128, 64], 'resnet50': [1024, 512, 256, 64],
|
| 68 |
'pvt_v2_b2': [512, 320, 128, 64], 'pvt_v2_b5': [512, 320, 128, 64],
|
|
|
|
| 62 |
'swin_v1_b', 'swin_v1_l', # 5-bs9, 6-bs4
|
| 63 |
'pvt_v2_b0', 'pvt_v2_b1', # 7, 8
|
| 64 |
'pvt_v2_b2', 'pvt_v2_b5', # 9-bs10, 10-bs5
|
| 65 |
+
][3]
|
| 66 |
self.lateral_channels_in_collection = {
|
| 67 |
'vgg16': [512, 256, 128, 64], 'vgg16bn': [512, 256, 128, 64], 'resnet50': [1024, 512, 256, 64],
|
| 68 |
'pvt_v2_b2': [512, 320, 128, 64], 'pvt_v2_b5': [512, 320, 128, 64],
|