Instructions to use NardoCreations/birefnet-lite-webgpu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use NardoCreations/birefnet-lite-webgpu with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("NardoCreations/birefnet-lite-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("NardoCreations/birefnet-lite-webgpu") - Notebooks
- Google Colab
- Kaggle
BiRefNet lite for WebGPU (640 × 640)
A re-export of ZhengPeng7/BiRefNet_lite (revision aa62cd8)
that runs in ONNX Runtime Web on WebGPU. It is NardoCut's high-quality background removal, run on the person's
own computer.
- Input:
1×3×640×640, RGB 0…1 (the ImageNet normalisation is inside the graph). Output: the person's matte,1×1×640×640, 0…1 (the sigmoid is inside the graph). - What changed: the deformable convolution (
torchvision.ops.deform_conv2d), which the public exports turn into ops WebGPU cannot run, is written as bilineargrid_sample× modulator + a 1×1 convolution: the same arithmetic (2·10⁻⁷ on the matte). Fixed shape, weights unchanged. Script:tools/birefnet/in the NardoCut repository. - Speed: ~0.5 s a frame on a laptop RTX 3050 in ONNX Runtime Web 1.30.
- License: MIT, as the original (
LICENSE, Copyright (c) 2024 ZhengPeng).
Model tree for NardoCreations/birefnet-lite-webgpu
Base model
ZhengPeng7/BiRefNet_lite