1 Star 0 Fork 0

87ssfantasy/pytorch-deep-image-matting

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

pytorch-deep-image-matting

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

Performance

model SAD MSE Grad Conn link
stage0-paper 59.6 0.019 40.5 59.3
stage1-paper 54.6 0.017 36.7 55.3
stage0-our 56.01 0.0173 33.71 57.57
stage1-our 54.42 0.0175 35.01 54.85 download
  • Lower metrics show better performance.
  • Training batch=1, images=43100, epochs=25, it takes about 2 days.
  • Test maxSize=1600.

Updates

  • 2019.10.29: conduct stage0 experiment using current code. Get Stage0-SAD=56.0.
  • 2019.09.09: conv6 kernel size from 1x1 to 3x3. Get Stage1-SAD=54.4. The performance of stage1 is as good as paper. While using model released before this day, please change the kernel_size=1 and padding=0 of conv6 in file core/net.py.
  • 2019.08.24: Fix cv2.dilate and cv2.erode iterations is set default = 1 and set triamp dilate and erode as the test 1k tirmap (k_size:2-5, iterations:5-15). Get Stage1-SAD=57.1.
  • 2019.07.05: Training with refine stage, fixed encoder-decoder. Get Stage2-SAD=57.7.
  • 2019.06.23: Training with alpha loss and composite loss. Get Stage1-SAD=58.7.
  • 2019.06.17: Training trimap generated by erode as well as dialte to balance the 0 and 1 value. Get Stage0-SAD=62.0.
  • 2019.04.22: Input image is normalized by mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225] and fix crop error. Get Stage0-SAD=69.1.
  • 2018.12.14: Initial. Get Stage0-SAD=72.9.

Installation

  • Python 2.7.12 or 3.6.5
  • Pytorch 0.4.0 or 1.0.0
  • OpenCV 3.4.3

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-SAD=57.1, please click to view whole images.

Image Trimap Pred-Alpha GT-Alpha
image image image image
image image image image
image image image image
image image image image
image image image image

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.

空文件

简介

Pytorch implementation of deep image matting 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ssfantasy/pytorch-deep-image-matting.git
git@gitee.com:ssfantasy/pytorch-deep-image-matting.git
ssfantasy
pytorch-deep-image-matting
pytorch-deep-image-matting
master

搜索帮助