项目作者: ShawnNew

项目描述 :
A Tri-map free direct Alpha Matting.
高级语言: Python
项目地址: git://github.com/ShawnNew/AMMNet.git
创建时间: 2019-03-05T17:45:16Z
项目社区:https://github.com/ShawnNew/AMMNet

开源协议:MIT License

下载


AMMNet

An Attention-based Multi-scale Matting Network is a tri-map(side information) free deep image matting network.

Dependencies

  • NumPy
  • torch
  • torchvision
  • pytorch
  • OpenCV
  • tensorboardX

Dataset

Adobe Deep Image Matting Dataset

Follow the instruction instruction to contact author for the dataset.

Data

I have trained the model using the adobe dataset and provide a pretrained model.
You have to define your customized dataloader based on the files in data_loader directory.

Dataset

Write dataset class refer to data_loader/create_dataset.py.

Dataloader

Write dataloader class refer to data_loader/data_loaders.py.

Usage

Train

  1. $ python train.py -c config.json

Resume

  1. $ python train.py --resume /dir/to/the/saveing/checkpoint -c config.json

Finetune

Finetune from a pretrained checkpoint.

  1. $ python train.py -f ./pretrained.pth -c config.json

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

  1. $ tensorboard --logdir saved/runs/

Test

Use test.py to test your dataset.

Results

From a best checkpoint of medium-depth network that are trained for 60 epoch.

image
image
image
image
image