BiRefNet-matting (ONNX)

ONNX export of ZhengPeng7/BiRefNet-matting, part of the MIT-licensed BiRefNet project. This repo contains only a format conversion (PyTorch → ONNX); all weights and credit belong to the original authors.

Why this export exists

BiRefNet uses torchvision::deform_conv2d (deformable convolution), which neither the legacy nor the dynamo ONNX exporter supports. This export replaces that op with a mathematically equivalent implementation built from grid_sample (validated numerically against torchvision.ops.deform_conv2d to < 1e-3), so the model runs in ONNX Runtime / Core ML EP.

Spec

Input input_image, float32, shape [1, 3, 1024, 1024], NCHW
Normalization ImageNet — mean [0.485, 0.456, 0.406], std [0.229, 0.224, 0.225]
Output output_image, [1, 1, 1024, 1024] logits — apply sigmoid for the alpha matte
Precision fp32 (~897 MB) · opset 16

License & attribution

MIT, following the upstream BiRefNet project (© Peng Zheng et al.). The original PyTorch model is ZhengPeng7/BiRefNet-matting.

Citation

@article{BiRefNet,
  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}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for emrikol/birefnet-matting-onnx

Quantized
(1)
this model