Home

Awesome

<div align="center"> <h1> ViTMatte🐒</h1> <h3> Boosting Image Matting with Pretrained Plain Vision Transformers</h3>

Jingfeng Yao<sup>1</sup>, Xinggang Wang<sup>1 📧</sup>, Shusheng Yang<sup>1</sup>, Baoyuan Wang<sup>2</sup>

<sup>1</sup> School of EIC, HUST, <sup>2</sup> Xiaobing.AI

(<sup>📧</sup>) corresponding author.

arxiv paper Colab Demo Static Badge license authors

PWC PWC

</div>

News

Introduction

<div align="center"><h4>Plain Vision Transformer could also do image matting with simple ViTMatte framework!</h4></div>

avatar

Recently, plain vision Transformers (ViTs) have shown impressive performance on various computer vision tasks, thanks to their strong modeling capacity and large-scale pretraining. However, they have not yet conquered the problem of image matting. We hypothesize that image matting could also be boosted by ViTs and present a new efficient and robust ViT-based matting system, named ViTMatte. Our method utilizes (i) a hybrid attention mechanism combined with a convolution neck to help ViTs achieve an excellent performance-computation trade-off in matting tasks. (ii) Additionally, we introduce the detail capture module, which just consists of simple lightweight convolutions to complement the detailed information required by matting. To the best of our knowledge, ViTMatte is the first work to unleash the potential of ViT on image matting with concise adaptation. It inherits many superior properties from ViT to matting, including various pretraining strategies, concise architecture design, and flexible inference strategies. We evaluate ViTMatte on Composition-1k and Distinctions-646, the most commonly used benchmark for image matting, our method achieves state-of-the-art performance and outperforms prior matting works by a large margin.

Get Started

Demo

You could try to matting the demo image with its corresponding trimap by run:

python run_one_image.py \
    --model vitmatte-s \
    --checkpoint-dir path/to/checkpoint

The demo images will be saved in ./demo. You could also try with your own image and trimap with the same file.

Besides, you can also try ViTMatte in Colab Demo. It is a simple demo to show the ability of ViTMatte.

Results

Quantitative Results on Composition-1k

ModelSADMSEGradConncheckpoints
ViTMatte-S21.463.37.2416.21GoogleDrive
ViTMatte-B20.333.06.7414.78GoogleDrive

Quantitative Results on Distinctions-646

ModelSADMSEGradConncheckpoints
ViTMatte-S21.222.18.7817.55GoogleDrive
ViTMatte-B17.051.57.0312.95GoogleDrive

Citation

@article{yao2024vitmatte,
  title={ViTMatte: Boosting image matting with pre-trained plain vision transformers},
  author={Yao, Jingfeng and Wang, Xinggang and Yang, Shusheng and Wang, Baoyuan},
  journal={Information Fusion},
  volume={103},
  pages={102091},
  year={2024},
  publisher={Elsevier}
}