Instructions to use anudit/BiRefNet_lite-2K-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use anudit/BiRefNet_lite-2K-ONNX with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("anudit/BiRefNet_lite-2K-ONNX", 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("anudit/BiRefNet_lite-2K-ONNX") - Notebooks
- Google Colab
- Kaggle
Add 1024x1024 variant for small inputs
Browse files- README.md +3 -0
- onnx/model_fp16_1024.onnx +3 -0
README.md
CHANGED
|
@@ -21,6 +21,9 @@ ONNX export of [ZhengPeng7/BiRefNet_lite-2K](https://huggingface.co/ZhengPeng7/B
|
|
| 21 |
|---|---|---|---|---|
|
| 22 |
| `onnx/model_fp16.onnx` | fp16 weights, fp32 I/O | `input_image` `[1,3,1440,2560]` (ImageNet-normalised RGB) | `output_image` `[1,1,1440,2560]` logits (apply sigmoid) | ~99 MB |
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
The input size is **fixed**: resize (stretch, no aspect preservation — this matches training) your image
|
| 25 |
to 2560×1440, run, then resize the mask back.
|
| 26 |
|
|
|
|
| 21 |
|---|---|---|---|---|
|
| 22 |
| `onnx/model_fp16.onnx` | fp16 weights, fp32 I/O | `input_image` `[1,3,1440,2560]` (ImageNet-normalised RGB) | `output_image` `[1,1,1440,2560]` logits (apply sigmoid) | ~99 MB |
|
| 23 |
|
| 24 |
+
`onnx/model_fp16_1024.onnx` is the same weights exported at a fixed `[1,3,1024,1024]` input (~93 MB, ~4× faster, ~¼ the memory);
|
| 25 |
+
`birefnet-webgpu` uses it automatically for small source images.
|
| 26 |
+
|
| 27 |
The input size is **fixed**: resize (stretch, no aspect preservation — this matches training) your image
|
| 28 |
to 2560×1440, run, then resize the mask back.
|
| 29 |
|
onnx/model_fp16_1024.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab11fddbecb0bbb8b07aa698d07f8fe15771b2714c992404a90588d7df2dc028
|
| 3 |
+
size 93445455
|