A pytorch implementation of the paper Free Form Image Inpainting with Gated Convolution. The code can be install as a python package called inpaint
. The inpaint package provides APIs to :
- Create a Pytorch Dataset for Places365 dataset
from inpaint.data import PlacesDataset
- Configure and setup Generator and Discriminator
from inpaint.core.discriminator import PatchDiscriminator from inpaint.core.generator import GatedGenerator'
- Configure and setup training, evaluation and prediction
from inpaint.tools import Trainer, Evaluate, predict
Tutorial and documentation for APIs are provided in the examples
directory.
Here's how to set up inpaint
for local development and testing.
-
Install Miniconda
-
Clone the repo locally::
$ git clone https://github.com/prajnan93/image-inpainting
-
Create a Conda virtual environment using the
env.yml
file. Install your local copy of the package into the environment::- $ conda env create -f env.yml
- $ conda activate inpaint
- $ python setup.py develop
-
Please note this repo is not accepting any contributions.
- Setup the inpaint conda environment as mentioned above.
- Follow the instructions provided in the jupyter notebooks in the directory
examples
. - Each notebook in the
examples
directory provides an example of mask visualization, training, evaluation and prediction. - Make sure to have at least 16Gb of CUDA GPU memory for training the model. Few example training scripts with differnt model configurations are provided in the
scripts
directory.
Download pretrained checkpoint .
google colab demo: coming soon
This repository acknowleges the official implementation of DeepFillV2 Free Form Image Inpainting and the Places365 Dataset datasets.
And thanks to Northeastern University Discovery HPC for providing the compute support.
@article{yu2018generative,
title={Generative Image Inpainting with Contextual Attention},
author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
journal={arXiv preprint arXiv:1801.07892},
year={2018}
}
@article{yu2018free,
title={Free-Form Image Inpainting with Gated Convolution},
author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
journal={arXiv preprint arXiv:1806.03589},
year={2018}
}
@article{zhou2017places,
title={Places: A 10 million Image Database for Scene Recognition},
author={Zhou, Bolei and Lapedriza, Agata and Khosla, Aditya and Oliva, Aude and Torralba, Antonio},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2017},
publisher={IEEE}
}
This python package is for education and research purposes only.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.