Instructions to use feyninc/multimatte with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- nobg
How to use feyninc/multimatte with nobg:
pip install nobg
# Option 1: use via the predict method from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("feyninc/multimatte").eval() processor = AutoProcessor.from_pretrained("feyninc/multimatte") cutout = model.predict(processor, "image.jpg", "prompt")# Option 2: use the model and processor directly import torch from loadimg import load_img from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("feyninc/multimatte").eval() processor = AutoProcessor.from_pretrained("feyninc/multimatte") 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
Push model using huggingface_hub.
Browse files- README.md +51 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: nobg
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- model_hub_mixin
|
| 6 |
+
- nobg
|
| 7 |
+
- nobg-sam3
|
| 8 |
+
- pytorch_model_hub_mixin
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
<p align="center">
|
| 12 |
+
<img src="https://usefeyn.com/feyn/feyn_mark.svg"/>
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration.
|
| 16 |
+
|
| 17 |
+
Library: [nobg](https://github.com/feyninc/nobg)
|
| 18 |
+
|
| 19 |
+
## how to load
|
| 20 |
+
```
|
| 21 |
+
pip install nobg
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
use the AutoModel class
|
| 25 |
+
```python
|
| 26 |
+
from nobg import AutoModel, AutoProcessor
|
| 27 |
+
model = AutoModel.from_pretrained("feyninc/multimatte")
|
| 28 |
+
processor = AutoProcessor.from_pretrained("feyninc/multimatte")
|
| 29 |
+
model.predict(processor, image)
|
| 30 |
+
```
|
| 31 |
+
or you can use the model class directly
|
| 32 |
+
```python
|
| 33 |
+
from nobg import Sam3
|
| 34 |
+
model = Sam3.from_pretrained("feyninc/multimatte")
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
## Citation
|
| 39 |
+
If you use this model, please cite:
|
| 40 |
+
```bibtex
|
| 41 |
+
@article{sam3,
|
| 42 |
+
title={SAM 3: Segment Anything with Concepts},
|
| 43 |
+
author={Carion, Nicolas and Gustafson, Laura and Hu, Yuan-Ting and Debnath, Shoubhik and Hu, Ronghang and Suris, Didac and Ryali, Chaitanya and Alwala, Kalyan Vasudev and Khedr, Haitham and Huang, Andrew and Lei, Jie and Ma, Tengyu and Guo, Baishan and Marks, Markus and Greer, Joseph and Wang, Meng and Sun, Peize and R{\"a}dle, Roman and Afouras, Triantafyllos and Mavroudi, Effrosyni and Dollar, Piotr and Ravi, Nikhila and Saenko, Kate and Zhang, Pengchuan and Feichtenhofer, Christoph},
|
| 44 |
+
journal={arXiv preprint},
|
| 45 |
+
year={2025},
|
| 46 |
+
url={https://ai.meta.com/research/publications/sam-3-segment-anything-with-concepts/},
|
| 47 |
+
}
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Contributions
|
| 51 |
+
Any contributions are welcome at https://github.com/feyninc/nobg
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ace8a4b1970313ff46429a673d71db031373412911530a82162d3c4b09f6fa16
|
| 3 |
+
size 3361696392
|