Skip to content

About

Pinokio launcher for MatAnyone 2 with enhanced UI - autosave, output folder, cleaner settings

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

MatAnyone 2

Practical human video matting framework that preserves fine details by avoiding segmentation-like boundaries, while also showing enhanced robustness under challenging real-world conditions.

What It Does

MatAnyone 2 takes a video and a first-frame segmentation mask as input, and produces:

  • Foreground output — the separated person/object with transparent background
  • Alpha matte output — the alpha channel showing the matting quality

The Gradio demo includes built-in SAM (Segment Anything Model) support, so you can interactively click to create masks directly in the web UI — no need to prepare masks externally.

How to Use

  1. Install — Click the Install button in Pinokio. This will clone the repo, set up a Python virtual environment, and install all dependencies.
  2. Start — Click Start to launch the Gradio web UI.
  3. Upload — Drop a video or image into the web interface.
  4. Mask — Click on the subject to create a segmentation mask. Use Positive/Negative point prompts to refine.
  5. Run — Click "Video Matting" or "Image Matting" to process.
  6. Results — Download the foreground and alpha matte outputs.

API Documentation

Python

from matanyone2.utils.get_default_model import get_matanyone2_model
from matanyone2.inference.inference_core import InferenceCore

# Load model
model = get_matanyone2_model("pretrained_models/matanyone2.pth", "cuda")
model = model.to("cuda").eval()

# Run inference
processor = InferenceCore(model, cfg=model.cfg)

CLI

cd app
python inference_matanyone2.py -i inputs/video/test-sample1 -m inputs/mask/test-sample1.png

Curl (Gradio API)

# When the Gradio server is running locally:
curl -X POST http://localhost:8000/api/predict \
  -H "Content-Type: application/json" \
  -d '{"data": ["video_path", "mask_data"]}'

Credits

About

Pinokio launcher for MatAnyone 2 with enhanced UI - autosave, output folder, cleaner settings

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages