Deep Image Matting paper implementation in PyTorch.
- "fc6" is dropped.
- Indices pooling.
"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.
- The Composition-1k testing dataset.
- Evaluate with whole image.
- SAD normalized by 1000.
- Input image is normalized with mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225].
- Both erode and dialte to generate trimap.
| Models | SAD | MSE | Download | 
|---|---|---|---|
| paper-stage0 | 59.6 | 0.019 | |
| paper-stage1 | 54.6 | 0.017 | |
| paper-stage3 | 50.4 | 0.014 | |
| my-stage0 | 66.8 | 0.024 | Link | 
- Python 3.5.2
- PyTorch 1.1.0
Follow the instruction to contact author for the dataset.
Go to MSCOCO to download:
Go to PASCAL VOC to download:
- VOC challenge 2008 training/validation data
- The test data for the VOC2008 challenge
Extract training images:
$ python pre_process.py$ python train.pyIf you want to visualize during training, run in your terminal:
$ tensorboard --logdir runs- Test:
$ python test.pyIt prints out average SAD and MSE errors when finished.
- 
Download the evaluation datasets: Go to the Datasets page and download the evaluation datasets. Make sure you pick the low-resolution dataset. 
- 
Extract evaluation images: 
$ python extract.py- Evaluate:
$ python eval.pyClick to view whole images:
| Image | Trimap1 | Trimap2 | Trimap3 | 
|---|---|---|---|
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
|  |  |  |  | 
Download pre-trained Deep Image Matting Link then run:
$ python demo.py| Image/Trimap | Output/GT | New BG/Compose | 
|---|---|---|
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
若对您有帮助可给予小小的赞助~
