Unofficial pytorch implementation of DeepFill v2, ICCV2019 paper Free-Form Image Inpainting with Gated Convolution
- Part of the code is derived from https://github.com/WonwoongCho/Generative-Inpainting-pytorch, especially the contextual attention module.
- Spectral normalization module is derived from https://github.com/christiancosgrove/pytorch-spectral-normalization-gan
- According to the author,for faces,extracting landmarks and then connecting them to generate user-guided edge maps. for natural scence, using HED edge detector to extract edge maps.In practice, I only implemented this code on CelebA Dataset,using both HED and facial landmark detector to generate the edge maps of face.
- check out the requirement
- download the pretrained model of 68-points facial landmark predictor and unzip it to
./facial_landmark_detector
folder. - download CelebA Dataset
- preproccess the edge maps of CelebA Dataset:
python preproccess_edge.py --face_preddictor_path xxx --img_read_path xxx --mask_save_path xxx
- run the train code after modifying
config.py
:
python run.py