Image Segmentation
BiRefNet
Safetensors
background-removal
mask-generation
Dichotomous Image Segmentation
pytorch_model_hub_mixin
model_hub_mixin
custom_code
Instructions to use ZhengPeng7/BiRefNet-DIS5K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use ZhengPeng7/BiRefNet-DIS5K with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("ZhengPeng7/BiRefNet-DIS5K", 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-DIS5K") - Notebooks
- Google Colab
- Kaggle
Update birefnet.py
Browse files- birefnet.py +1 -1
birefnet.py
CHANGED
|
@@ -7,7 +7,7 @@ import math
|
|
| 7 |
class Config():
|
| 8 |
def __init__(self) -> None:
|
| 9 |
# PATH settings
|
| 10 |
-
self.sys_home_dir = os.
|
| 11 |
|
| 12 |
# TASK settings
|
| 13 |
self.task = ['DIS5K', 'COD', 'HRSOD', 'DIS5K+HRSOD+HRS10K', 'P3M-10k'][0]
|
|
|
|
| 7 |
class Config():
|
| 8 |
def __init__(self) -> None:
|
| 9 |
# PATH settings
|
| 10 |
+
self.sys_home_dir = os.path.expanduser('~') # Make up your file system as: SYS_HOME_DIR/codes/dis/BiRefNet, SYS_HOME_DIR/datasets/dis/xx, SYS_HOME_DIR/weights/xx
|
| 11 |
|
| 12 |
# TASK settings
|
| 13 |
self.task = ['DIS5K', 'COD', 'HRSOD', 'DIS5K+HRSOD+HRS10K', 'P3M-10k'][0]
|