Instructions to use Q-P1NG/birefnet-lite-512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use Q-P1NG/birefnet-lite-512 with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("Q-P1NG/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("Q-P1NG/birefnet-lite-512") - Notebooks
- Google Colab
- Kaggle
BiRefNet lite 512 (ONNX), as the Q-P1NG app downloads it
An unchanged copy of the 512 x 512 ONNX export of BiRefNet lite
(Peng Zheng et al., MIT) made by Studio Ludens: studioludens/birefnet-lite-512
at commit 962e67969ec6acec9c19fab76acee4f5e22e990c (onnx/model.onnx here as model.onnx). It is kept here so that
the Q-P1NG app's cut-out pack downloads from a place that does not change; the app checks every file's SHA-256 before
using it.
| File | SHA-256 | Bytes |
|---|---|---|
model.onnx |
1cb0fb360dadd15af77c639085d77a9df67db0c64315560c3de005f676345ac2 |
191877254 |
preprocessor_config.json |
a79663b311d8404dfb329f7b45bc9f970a0c155aeedae8ac15b6b77d76789613 |
389 |
LICENSE |
b5cd5faac84a0acb8a6bdb8aeef0919e528891be27216df84eab398d7c8bd2aa |
1106 |
Input and output
- Input
input_image: float32[1, 3, 512, 512], RGB resized to 512 x 512, rescaled by 1/255 and normalised with ImageNet's mean[0.485, 0.456, 0.406]and deviation[0.229, 0.224, 0.225]. - Output
output_image: float32[1, 1, 512, 512]logits; a sigmoid gives the alpha matte, to be brought back to the picture's size.
Full precision weights only: the float16 export of the same repository computes in float16 throughout, which ONNX Runtime's CPU does not run on every phone.
License
MIT, as the original: see LICENSE (Copyright (c) 2024 ZhengPeng, Copyright (c) 2026 Studio Ludens V.O.F.).
Citation
@article{zheng2024birefnet,
title={Bilateral Reference for High-Resolution Dichotomous Image Segmentation},
author={Zheng, Peng and Gao, Dehong and Fan, Deng-Ping and Liu, Li and Laaksonen, Jorma and Ouyang, Wanli and Sebe, Nicu},
journal={CAAI Artificial Intelligence Research},
year={2024}
}
Model tree for Q-P1NG/birefnet-lite-512
Base model
ZhengPeng7/BiRefNet_lite