FeyNobg

A background-removal model from Feyn Inc. that deepens BiRefNet's architecture and retrains it. LibreYOLO ships inference and validation for FeyNobg's matte task.

Tasks
matte
Sizes
l at 1024 px
Install
pip install libreyolo
Support tier
Inference only, since v. Predict, validate and export only. Training features do not apply.
Upstream
FeyNobg by Feyn Inc., Apache-2.0. Paper, source
Licenses
Code MIT, weights Apache-2.0. Commercial use

Install

FeyNobg needs no optional extra. Everything it imports is in the base install.

bash
pip install libreyolo

Predict

The checkpoint downloads from the LibreYOLO organization on Hugging Face on first use and is cached locally, the same as any other family, though it is not yet listed in the Checkpoints table on this page.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreFeyNobgl-matte.pt")result = model(SAMPLE_IMAGE, save=True) matte = result.matteprint(matte.array.shape, matte.array.dtype)
CLI
libreyolo predict model=LibreFeyNobgl-matte.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
Cutout
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreFeyNobgl-matte.pt")result = model(SAMPLE_IMAGE) # RGBA (H, W, 4) uint8: source RGB plus the matte as an alpha channel.rgba = result.cutout()result.save("subject.png")

A matte result carries no boxes; result.matte is a dense (H, W) float32 array in [0, 1], 1 fully foreground and 0 fully background. Unlike a binary mask, the soft matte keeps anti-aliased edge detail such as hair and fur. result.cutout() composites the source image with that alpha channel into an RGBA array, and result.save(path) (or save=True on the predict call) writes it straight to a transparent-background PNG. The model runs at a fixed native 1024x1024 canvas; a different resolution is not supported, because the Swin backbone's relative-position tables are tied to it, and a mismatch interpolates them badly rather than raising an error. See prediction for sources, streaming and result handling.

Variants

One published size, l, a Swin-L tier backbone. FeyNobg takes BiRefNet's architecture and deepens its third Swin stage from 18 to 24 blocks before retraining, so the LibreYOLO port reuses BiRefNet's forward path, preprocessing and single-logit output contract; predict, validate and checkpoint handling behave the same as the birefnet family.

Validate

val() reports two metrics over a paired image/matte folder, both in [0, 1] and independent of resolution: MAE, the mean absolute error against the ground-truth alpha (lower is better), and S-measure (Fan et al., ICCV 2017), a structural similarity that credits preserving the subject's shape and holes, which pixel MAE alone misses (higher is better). Validation drives the model's own predict, so it uses the family's exact preprocessing.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreFeyNobgl-matte.pt") # A directory containing images/ and an auto-detected matte directory# (mattes/, matte/, gt/, masks/, mask/ or alpha/) also works in place# of a dataset YAML.metrics = model.val(data="my-matte-dataset/") print(metrics["metrics/MAE"])print(metrics["metrics/Smeasure"])

Validation is inference-only. The upstream nobg library ships Apache-2.0 training code; fine-tuning today means training there and converting the result with LibreYOLO's own conversion script, not calling train() on this family, which raises rather than running a partial trainer.

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
FeyNobg, Feyn Inc.
Upstream license
Apache-2.0
LibreYOLO code
MIT
Weights
Apache-2.0, republished at huggingface.co/LibreYOLO
Interpretation
Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code. FeyNobg builds on BiRefNet's architecture (MIT) with a deepened backbone stage, and Feyn Inc. releases both the nobg library and the FeyNobg weights under Apache-2.0. LibreYOLO's checkpoint is a format conversion of Feyn's own published weights, with the learned parameters unchanged; fine-tuning is not wired into this library, so there is no LibreYOLO-trained variant to license separately.

Citation

@software{nobg,
  title={nobg: Open Source Background Removal Models for Image and Video Matting},
  author={Hichri, Hafedh},
  year={2026},
  url={https://github.com/feyninc/nobg},
  license={Apache-2.0},
}

Copied from the authors' citation block at github.com/feyninc/nobg#citation.

Verified against LibreYOLO v1.5.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.