Instructions to use facebook/sapiens2-matting-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sapiens
How to use facebook/sapiens2-matting-1b with sapiens:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- sapiens2
How to use facebook/sapiens2-matting-1b with sapiens2:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
| license: other | |
| license_name: sapiens2-license | |
| license_link: https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md | |
| pipeline_tag: image-segmentation | |
| library_name: sapiens | |
| base_model: facebook/sapiens2-pretrain-1b | |
| tags: | |
| - sapiens | |
| - sapiens2 | |
| - human-centric | |
| - matting | |
| # Sapiens2-1B-Matting | |
| Per-pixel human image matting with a soft alpha matte and pre-multiplied | |
| foreground RGB output. | |
| This repository contains the **1B Human Matting** checkpoint, finetuned from the | |
| [Sapiens2-1B pretrained backbone](https://huggingface.co/facebook/sapiens2-pretrain-1b). | |
| - π **Paper:** [arXiv:2604.21681](https://arxiv.org/pdf/2604.21681) | |
| - π **Project Page:** [rawalkhirodkar.github.io/sapiens2](https://rawalkhirodkar.github.io/sapiens2) | |
| - π» **Code:** [github.com/facebookresearch/sapiens2](https://github.com/facebookresearch/sapiens2) | |
| ## Model Details | |
| - **Developed by:** Meta | |
| - **Model type:** Vision Transformer | |
| - **License:** [Sapiens2 License](https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md) | |
| - **Task:** Human image matting | |
| - **Base model:** [facebook/sapiens2-pretrain-1b](https://huggingface.co/facebook/sapiens2-pretrain-1b) | |
| - **Format:** safetensors | |
| - **File:** `sapiens2_1b_matting.safetensors` | |
| ## Quick Start | |
| Install the [Sapiens2 repo](https://github.com/facebookresearch/sapiens2) (`pip install -e .`), download the checkpoint, and run the demo: | |
| ```bash | |
| # 1. Download the checkpoint to $SAPIENS_CHECKPOINT_ROOT/matting/ | |
| hf download facebook/sapiens2-matting-1b sapiens2_1b_matting.safetensors \ | |
| --local-dir ~/sapiens2_host/matting | |
| # 2. Run the demo (edit INPUT, OUTPUT, and MODEL_NAME inside the script) | |
| cd $SAPIENS_ROOT/sapiens/dense | |
| ./scripts/demo/matting.sh | |
| ``` | |
| See the [Human Matting guide](https://github.com/facebookresearch/sapiens2/blob/main/docs/MATTING.md) for details on inputs, outputs, and visualization options. | |
| ## Model Card | |
| | Field | Value | | |
| |-------|-------| | |
| | Architecture | Sapiens2 ViT backbone + Human Matting head | | |
| | Backbone parameters | 1.462 B | | |
| | Backbone FLOPs | 4.715 T | | |
| | Embedding dim | 1536 | | |
| | Layers | 40 | | |
| | Attention heads | 24 | | |
| | Inference resolution | 1024 Γ 768 (H Γ W) | | |
| | Patch size | 16 | | |
| ### Sapiens2-Matting Family | |
| | Model | Params | FLOPs | Embed dim | Layers | Heads | | |
| |-------|--------|-------|-----------|--------|-------| | |
| | **Sapiens2-1B** *(this)* | 1.462 B | 4.715 T | 1536 | 40 | 24 | | |
| See the [Sapiens2 Collection](https://huggingface.co/collections/facebook/sapiens2) for all variants and other downstream task checkpoints. | |
| ## Intended Use | |
| - Human image matting on human-centric imagery | |
| - Research on human-centric vision | |
| ## License | |
| Released under the [Sapiens2 License](https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md). | |
| ## Citation | |
| ```bibtex | |
| @article{khirodkarsapiens2, | |
| title={Sapiens2}, | |
| author={Khirodkar, Rawal and Wen, He and Martinez, Julieta and Dong, Yuan and Su, Zhaoen and Saito, Shunsuke}, | |
| journal={arXiv preprint arXiv:2604.21681}, | |
| year={2026} | |
| } | |
| ``` | |