Image Segmentation
Transformers.js
ONNX
BiRefNet
swin
background-removal
matting
webgpu
alpha-matting
image-matting
foreground-extraction
salient-object-detection
dichotomous-image-segmentation
client-side
transformers-js
fp16
Instructions to use studioludens/birefnet-lite-512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use studioludens/birefnet-lite-512 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'studioludens/birefnet-lite-512'); - BiRefNet
How to use studioludens/birefnet-lite-512 with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("studioludens/birefnet-lite-512", 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("studioludens/birefnet-lite-512") - Notebooks
- Google Colab
- Kaggle
| { | |
| "do_normalize": true, | |
| "do_rescale": true, | |
| "do_resize": true, | |
| "feature_extractor_type": "ViTFeatureExtractor", | |
| "image_mean": [ | |
| 0.485, | |
| 0.456, | |
| 0.406 | |
| ], | |
| "image_processor_type": "ViTFeatureExtractor", | |
| "image_std": [ | |
| 0.229, | |
| 0.224, | |
| 0.225 | |
| ], | |
| "resample": 2, | |
| "rescale_factor": 0.00392156862745098, | |
| "size": { | |
| "height": 512, | |
| "width": 512 | |
| } | |
| } |