Image Segmentation
ONNX
nobg
background-removal
image-matting
onnxruntime
feynobg
soft-alpha
transparency
rgba
Instructions to use PinkPixel/fey-nobg-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- nobg
How to use PinkPixel/fey-nobg-onnx with nobg:
pip install nobg
# Option 1: use via the predict method from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("PinkPixel/fey-nobg-onnx").eval() processor = AutoProcessor.from_pretrained("PinkPixel/fey-nobg-onnx") cutout = model.predict(processor, "image.jpg")# Option 2: use the model and processor directly import torch from loadimg import load_img from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("PinkPixel/fey-nobg-onnx").eval() processor = AutoProcessor.from_pretrained("PinkPixel/fey-nobg-onnx") image = load_img("image.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
Ctrl+K