vitmatte
An image matting model that adapts a plain Vision Transformer to predict an alpha matte from an image and trimap.
Segmentation · 997 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Segmentation
- Parameters
- 25.8M
- Operations
- 997
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2023
- Authors
- Jingfeng Yao, Xinggang Wang, Shusheng Yang, Baoyuan Wang
- Source
- transformers 5.18.0
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m11144
- Graph hash
- 4267a84ecbb5c7e44624915b49e76b98d135932f165a703f42c0ff183f947bf4
- Skeleton hash
- 3b7d16b727b1e88b4899536e9cc424d0b116af154577aac958f3f3d726510bb7
- Architecture hash
- a180c6a3463abd9b25c60a9ac39e1eccf7d4736a5c828263e23d050ba23b878e
- Diagram SHA-256
- 0601d5a733f3ff0c99045363f4aa1b90909bd930586083090c6b6cd55aeb19df
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ViTMatte is a model for image matting, the task of accurately estimating the foreground object in an image. Its premise is that a plain Vision Transformer (ViT), with a small amount of adaptation, can be used for matting.
The input is an RGB image concatenated channel-wise with its trimap, a manually drawn hint. Inside the ViT, the blocks are divided into groups, and only the last block of each group applies global attention while the others use window attention. The paper calls this a hybrid attention mechanism and also adds a convolution neck between transformer blocks. Because the plain ViT produces only a single feature map with a stride of 16, a detail capture module made of a cascade of convolutional layers adds the fine detail that matting needs.
The paper initializes ViTMatte-S and ViTMatte-B from DINO and MAE pretrained weights respectively. On Composition-1k, the authors' repository lists a SAD of 21.46 and an MSE of 3.3 for ViTMatte-S.
Key idea. ViTMatte adapts a plain vision transformer to image matting with hybrid window and global attention, a convolution neck and a lightweight convolutional detail capture module.
- ViTMatte
- image matting
- alpha matte
- trimap matting
- ViT matting
- plain vision transformer
- Composition-1k
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{yao2023vitmatteboostingimagematting,
title={ViTMatte: Boosting Image Matting with Pretrained Plain Vision Transformers},
author={Jingfeng Yao and Xinggang Wang and Shusheng Yang and Baoyuan Wang},
year={2023},
eprint={2305.15272},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2305.15272},
}