Skip to content

saba99/Video-Background-Matting

Repository files navigation

High-Resolution Background Matting

Paper

Real-Time High-Resolution Background Matting. model requires capturing an additional background image and produces state-of-the-art matting results at 4K 30fps and HD 60fps .

Download

Model / Weights

Video / Image Examples

Datasets

 

Video Demo

Before

input.mp4

After

com-woman.mp4

Image Demo

Before

src

After

com

Scripts

We provide several scripts in this repo for you to experiment with our model. More detailed instructions are included in the files.

  • inference_images.py: Perform matting on a directory of images.
  • inference_video.py: Perform matting on a video.
  • inference_webcam.py: An interactive matting demo using your webcam.

Notebooks

Additionally, you can try our notebooks in Google Colab for performing matting on images and videos.

Usage / Documentation

You can run our model using PyTorch, TorchScript, TensorFlow, and ONNX. For detail about using our model, please check out the Usage / Documentation page.

 

Training

Configure data_path.pth to point to your dataset. The original paper uses train_base.pth to train only the base model till convergence then use train_refine.pth to train the entire network end-to-end. More details are specified in the paper.