Scaling Video Matting via a Learned Quality Evaluator
1S-Lab, Nanyang Technological University
2SenseTime Research, Singapore
†Project lead
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.
:movie_camera: For more visual results, go checkout our
project page
---
## 📮 Update
- [2026.03] Add uv and huggingface support for easy installation and usage.
- [2026.03] Release inference codes, evaluation codes, and gradio demo.
- [2025.12] This repo is created.
## 🏄🏻♀️ TODO
- [x] Release inference codes and gradio demo.
- [x] Release evaluation codes.
- [ ] Release training codes for video matting model.
- [ ] Release checkpoint and training codes for quality evaluator model.
- [ ] Release real-world video matting dataset **VMReal**.
## 🔎 Overview

## 🔧 Installation
### From PyPI / Source
```bash
# install from repo
pip install git+https://github.com/pq-yang/MatAnyone2.git#egg=matanyone2
# or install optional extras
pip install git+https://github.com/pq-yang/MatAnyone2.git#egg=matanyone2[gui] # Gradio demo + PySide6
pip install git+https://github.com/pq-yang/MatAnyone2.git#egg=matanyone2[dev] # development / evaluation tools
pip install git+https://github.com/pq-yang/MatAnyone2.git#egg=matanyone2[all] # everything
```
### Conda
```bash
conda create -n matanyone2 python=3.10 -y
conda activate matanyone2
pip install git+https://github.com/pq-yang/MatAnyone2.git#egg=matanyone2[all]
```
### uv (recommended)
```bash
# create a new project and add matanyone2
uv init my-matting-project && cd my-matting-project
uv add matanyone2@git+https://github.com/pq-yang/MatAnyone2.git
# or with optional extras
uv add matanyone2[gui]@git+https://github.com/pq-yang/MatAnyone2.git
uv add matanyone2[all]@git+https://github.com/pq-yang/MatAnyone2.git
```
## 🔥 Inference
### Download Model
Download our pretrained model from [MatAnyone 2](https://github.com/pq-yang/MatAnyone2/releases/download/v1.0.0/matanyone2.pth) to the `pretrained_models` folder (pretrained model can also be automatically downloaded during the first inference).
The directory structure will be arranged as:
```
pretrained_models
|- matanyone2.pth
```
### Quick Test
We provide some examples in the [`inputs`](./inputs) folder. **For each run, we take a video and its first-frame segmenatation mask as input.**