Instructions to use feyninc/FeyNobg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- nobg
How to use feyninc/FeyNobg with nobg:
pip install nobg
import torch from loadimg import load_img from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("feyninc/FeyNobg").eval() processor = AutoProcessor.from_pretrained("feyninc/FeyNobg") image = load_img("input.jpg").convert("RGB") inputs = processor(image, return_tensors="pt") with torch.no_grad(): outputs = model(pixel_values=inputs["pixel_values"]) alpha = processor.post_process_alpha_matting(outputs, target_sizes=[(image.height, image.width)])[0] processor.cutout(image, alpha).save("output.png") - Notebooks
- Google Colab
- Kaggle
fixes π¨
#2
pinned
by not-lain - opened
this repo will now only work with nobg>=0.2.5
consider updating your library version, all other model finetunes, copies, .... will keep working as they should since i have implemented a backward fallback.
if you have a copy of the model consider switching tags from birefnet -> nobg-birefnet as shown in https://huggingface.co/feyninc/FeyNobg/commit/c9edb8ab325a0646e485cf89457f061950602fc0 , else the fallback mechanism will still work regardless
not-lain pinned discussion