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
| { | |
| "dec_channels_inter": 64, | |
| "depths": [ | |
| 2, | |
| 2, | |
| 24, | |
| 2 | |
| ], | |
| "drop_path_rate": 0.2, | |
| "embed_dim": 192, | |
| "image_size": 1024, | |
| "mlp_ratio": 4.0, | |
| "nobg_version": "0.2.0", | |
| "num_heads": [ | |
| 6, | |
| 12, | |
| 24, | |
| 48 | |
| ], | |
| "num_layers": 4, | |
| "patch_size": 4, | |
| "use_gradient_attention": true, | |
| "use_image_patch_injection": true, | |
| "use_multi_scale_input": true, | |
| "window_size": 12 | |
| } |