Home

Awesome

pytorch-deep-image-matting

This repository includes the non-official pytorch implementation of deep image matting.

Performance

modelSAD ↓MSE ↓Grad ↓Conn ↓link
stage0-paper59.60.01940.559.3
stage1-paper54.60.01736.755.3
stage0-our56.010.017333.7157.57
stage1-our54.420.017535.0154.85download
stage1-our-skip52.990.017131.5653.24download

Updates

Installation

Demo

Download our model to the ./model and run the following command. Then the predict alpha mattes will locate in the folder ./result/example/pred.

python core/demo.py

Training

Adobe-Deep-Image-Matting-Dataset

Please concat author for available.

MSCOCO-2017-Train-Dataset

Download

PASCAL-VOC-2012

Download

Composite-Dataset

Run the following command and the composite training and test dataset will locate in Combined_Dataset/Training_set/comp and Combined_Dataset/Test_set/comp, Combined_Dataset is the extracted folder of Adobe-Deep-Image-Matting-Dataset

python tools/composite.py

Pretrained-Model

Run the following command and the pretrained model will locate in ./model/vgg_state_dict.pth

python tools/chg_model.py

Start Training

Run the following command and start the training

bash train.sh

Test

Run the following command and start the test of Adobe-1k-Composite-Dataset

bash deploy.sh

Evaluation

Please eval with official Matlab Code. and get the SAD, MSE, Grad Conn.

Visualization

Running model is Stage1-Skip-SAD=52.9, please click to view whole images.

ImageTrimapPred-AlphaGT-Alpha
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage

Disclaimer

As covered by the ADOBE IMAGE DATASET LICENSE AGREEMENT, the pre-trained models included in this repository can only be used and distributed for non-commercial purposes.