imageMatting
imageMatting copied to clipboard
Simplified Deep Image Matting training code with keras on tensorflow
Deep Image Matting
Image Matting. Given an image, the code in this project can separate its foreground and background components. This repository is to reproduce Deep image matting and is a modification to the codes used by foamliu.
History
Hi all, All of us must have tried finding available github codes to train a Deep Image Matting model. The most common repository we come across is foamliu's repo. The repository is no longer being maintained and the documentation doesn't seem to be sufficient to help with the training. In light of this, I have created this repository for Deep Image matting training in tensorflow which I shall maintain and help solve your problems. I have also added various functionalities in the train.py to help configure your training. I have made the training process very simple. All you need to do is run 'python train.py' and you are all set. Appropriate comments have been added to ensure you can tune the parameters according to your use. If you get stuck anywhere, feel free to reach out.
Dependencies
Dataset
Custom Dataset
- Use the 'data' folder to provide the dataset
- data/train_names.txt - Provide the names of the training files here. It will automatically detect the mask file names using the naming convention followed. You can refer to the existing sample data in the folders to know more.
- data/valid_names.txt - Provide the names of the validation files here.
- data/input - Contains the input files with merged foreground and background.
- data/mask - Contains the binary mask for foregrounds.
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:
- VOC challenge 2008 training/validation data
- The test data for the VOC2008 challenge
ImageNet Pretrained Models (Must-do)
Download VGG16 into "models" folder.
Results using the pre-trained model:
Download foamliu's pre-trained Deep Image Matting Model.
Image/Trimap | Output/GT | New BG/Compose |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |