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
Download tokenizer.json from feyninc/multimatte: direct link, hf CLI and curl.
- Browser
- Download file 3.64 MB
-
https://huggingface.co/feyninc/multimatte/resolve/main/tokenizer.json
- Command line
-
hf download hf://feyninc/multimatte/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/feyninc/multimatte/resolve/main/tokenizer.json
3.64 MB
File too large to display, you can check the raw version instead.