Home

Awesome

Deep Image Matting

Deep Image Matting paper implementation in PyTorch.

Differences

  1. "fc6" is dropped.
  2. Indices pooling.
<p>"fc6" is clumpy, over 100 millions parameters, makes the model hard to converge. I guess it is the reason why the model (paper) has to be trained stagewisely.

Performance

ModelsSADMSEDownload
paper-stage059.60.019
paper-stage154.60.017
paper-stage350.40.014
my-stage066.80.024Link

Dependencies

Dataset

Adobe Deep Image Matting Dataset

Follow the instruction to contact author for the dataset.

MSCOCO

Go to MSCOCO to download:

PASCAL VOC

Go to PASCAL VOC to download:

Usage

Data Pre-processing

Extract training images:

$ python pre_process.py

Train

$ python train.py

If you want to visualize during training, run in your terminal:

$ tensorboard --logdir runs

Experimental results

The Composition-1k testing dataset

  1. Test:
$ python test.py

It prints out average SAD and MSE errors when finished.

The alphamatting.com dataset

  1. Download the evaluation datasets: Go to the Datasets page and download the evaluation datasets. Make sure you pick the low-resolution dataset.

  2. Extract evaluation images:

$ python extract.py
  1. Evaluate:
$ python eval.py

Click to view whole images:

ImageTrimap1Trimap2Trimap3
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage
imageimageimageimage

Demo

Download pre-trained Deep Image Matting Link then run:

$ python demo.py
Image/TrimapOutput/GTNew BG/Compose
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage
imageimageimage

小小的赞助~

<p align="center"> <img src="https://github.com/foamliu/Deep-Image-Matting-Pytorch/blob/master/sponsor.jpg" alt="Sample" width="324" height="504"> <p align="center"> <em>若对您有帮助可给予小小的赞助~</em> </p> </p> <br/><br/><br/>