Image Segmentation
Transformers.js
ONNX
BiRefNet
swin
background-removal
dichotomous-image-segmentation
webgpu
onnxruntime-web
Instructions to use CardAnvilModels/BiRefNet-lite-1024-WebGPU with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use CardAnvilModels/BiRefNet-lite-1024-WebGPU with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'CardAnvilModels/BiRefNet-lite-1024-WebGPU'); - BiRefNet
How to use CardAnvilModels/BiRefNet-lite-1024-WebGPU with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("CardAnvilModels/BiRefNet-lite-1024-WebGPU", 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("CardAnvilModels/BiRefNet-lite-1024-WebGPU") - Notebooks
- Google Colab
- Kaggle
Download config.json from CardAnvilModels/BiRefNet-lite-1024-WebGPU: direct link, hf CLI and curl.
- Browser
- Download file 81 Bytes
-
https://huggingface.co/CardAnvilModels/BiRefNet-lite-1024-WebGPU/resolve/main/config.json
- Command line
-
hf download hf://CardAnvilModels/BiRefNet-lite-1024-WebGPU/config.json
-
curl -L -o config.json https://huggingface.co/CardAnvilModels/BiRefNet-lite-1024-WebGPU/resolve/main/config.json
81 Bytes
| { | |
| "model_type": "swin", | |
| "transformers.js_config": { | |
| "dtype": "fp32" | |
| } | |
| } |