| | --- |
| | library_name: matanyone2 |
| | tags: |
| | - model_hub_mixin |
| | - pytorch_model_hub_mixin |
| | --- |
| | |
| | <div align="center"> |
| | <img src="https://github.com/pq-yang/MatAnyone2/blob/main/assets/matanyone2_logo.png?raw=true" alt="MatAnyone Logo" style="height: 52px;"> |
| | <div style="text-align: center"> |
| | <h2>Scaling Video Matting via a Learned Quality Evaluator</h2> |
| | </div> |
| | |
| | <div> |
| | <a href='https://pq-yang.github.io/' target='_blank'>Peiqing Yang</a><sup>1</sup>  |
| | <a href='https://shangchenzhou.com/' target='_blank'>Shangchen Zhou</a><sup>1†</sup>  |
| | <a href="https://www.linkedin.com/in/kai-hao-794321382/" target='_blank'>Kai Hao</a><sup>1</sup>  |
| | <a href="https://scholar.google.com.sg/citations?user=fMXnSGMAAAAJ&hl=en/" target='_blank'>Qingyi Tao</a><sup>2</sup>  |
| | </div> |
| | <div> |
| | <sup>1</sup>S-Lab, Nanyang Technological University  |
| | <sup>2</sup>SenseTime Research, Singapore  |
| | <br> |
| | <sup>†</sup>Project lead |
| | </div> |
| | |
| |
|
| | <div> |
| | <h4 align="center"> |
| | <a href="https://pq-yang.github.io/projects/MatAnyone2/" target='_blank'> |
| | <img src="https://img.shields.io/badge/😈-Project%20Page-blue"> |
| | </a> |
| | <a href="https://arxiv.org/abs/2512.11782" target='_blank'> |
| | <img src="https://img.shields.io/badge/arXiv-2501.14677-b31b1b.svg"> |
| | </a> |
| | <a href="https://www.youtube.com/watch?v=tyi8CNyjOhc&lc=Ugw1OS7z5QbW29RZCFZ4AaABAg" target='_blank'> |
| | <img src="https://img.shields.io/badge/Demo%20Video-%23FF0000.svg?logo=YouTube&logoColor=white"> |
| | </a> |
| | <a href="https://huggingface.co/spaces/PeiqingYang/MatAnyone" target='_blank'> |
| | <img src="https://img.shields.io/badge/Demo-%F0%9F%A4%97%20Hugging%20Face-blue"> |
| | </a> |
| | <a href="https://colab.research.google.com/drive/1NYW_CUDf7jnzxir7tOOlY7wRRalVOifD?usp=sharing" target='_blank'> |
| | <img src="https://colab.research.google.com/assets/colab-badge.svg"> |
| | </a> |
| | </h4> |
| | </div> |
| | |
| | <strong>MatAnyone 2 is a practical human video matting framework that preserves fine details by avoiding segmentation-like boundaries, while also shows enhanced robustness under challenging real-world conditions.</strong> |
| |
|
| | <div style="width: 100%; text-align: center; margin:auto;"> |
| | <img style="width:100%" src="https://github.com/pq-yang/MatAnyone2/blob/main/assets/teaser.jpg?raw=true"> |
| | </div> |
| | |
| | 🎥 For more visual results, go checkout our <a href="https://pq-yang.github.io/projects/MatAnyone2/" target="_blank">project page</a> |
| |
|
| | </div> |
| |
|
| | --- |
| |
|
| | ## How to use |
| | you can run the following commands to get started and start working with the model |
| | ``` |
| | pip install -qqU git+https://github.com/pq-yang/MatAnyone2.git |
| | ``` |
| |
|
| | ```python |
| | from matanyone2 import MatAnyone2, InferenceCore |
| | model = MatAnyone2.from_pretrained("PeiqingYang/MatAnyone2") |
| | processor = InferenceCore(model,device="cuda:0") |
| | # inference |
| | processor.process_video(input_path="inputs/video/test-sample2.mp4", |
| | mask_path="inputs/mask/test-sample2.png", |
| | output_path="results") |
| | ``` |
| |
|