BiRefNet background removal (BiRefNet general (Swin-L tier), the quality default), repackaged for LibreYOLO's
matte task. Predicts a soft alpha matte at a fixed native 1024x1024.
1from libreyolo import LibreYOLO
2
3m = LibreYOLO("LibreBiRefNetl-matte.pt")
4res = m.predict("product.jpg")
5res[0].matte # (H, W) float alpha in [0, 1]
6res[0].save("cut.png") # transparent-background PNG
Derived from
ZhengPeng7/BiRefNet
at commit d83f355.
Copyright (c) 2024 ZhengPeng (Peng Zheng). Licensed under the MIT License.
Backbone: Swin Transformer v1 (Swin-L).
Training data provenance (upstream): the BiRefNet DIS/General checkpoints are
trained on dichotomous-image-segmentation datasets (e.g. DIS5K) under their own
academic terms; this repo hosts the author's released weights and does not
redistribute training data.
State-dict key remapping only (metadata-wrap into the LibreYOLO v1.0 checkpoint
schema). Learned parameters are unchanged. Our fp32 forward matches the upstream
released weights with
max_abs_diff == 0. See
weights/convert_birefnet_weights.py in the
LibreYOLO source repository.