An unofficial TensorFlow implementation of Free-Form Image Inpainting with Gated Convolution (https://arxiv.org/abs/1806.03589).
- Python 3
- Tensorflow >= 1.4
- Neuralgym (https://github.com/JiahuiYu/neuralgym)
- Download Places2 dataset (http://places2.csail.mit.edu/download.html). High resolution images are suggested.
- Create flist. Modify 'flist_maker' file and run 'python flist_maker'.
- Modify 'inpaint.yml' file. Set 'RANDOMCROP' to 'True' if you have downloaded high resolution images. If set to 'True', the model will randomly crop 256x256 portion from the images. If set to 'False', the model will resize the images to 256x256 or use 256x256 images.
- In case of resuming training, modify 'LOG_DIR' and start training from a checkpoint, e.g. 'LOG_DIR: 20190614190532339796_nadim-PMBSB09A-Samsung-DeskTop_places2_MASKED_sn_pgan_full_model_places2_256'
- Change 'npmask' function in 'test.py' to make different sized masks for testing.
- Run 'python test.py --image IMAGE_LOCATION --checkpoint_dir CHECKPOINT_LOCATION' (e.g. python test.py --image 1.jpg --checkpoint_dir ./model_logs/20190614132226313697_nadim-PMBSB09A-Samsung-DeskTop_places2_MASKED_sn_pgan_full_model_places2_256/)
- Modify inpaint_ops.py. - Added modified discriminator convolution layers and mask generation function as per suggestions from JiahuiYu/generative_inpainting#62.
- Slim model by 25% - Still training with original width of the model. You can slim the model by 25% by setting cnum = 32 * 0.75.
- Provide pretrained model - Will provide after finishing training.
- Provide loss graph - Will update soon.
- Provide test results - Still training.
- https://github.com/avalonstrel/GatedConvolution - The Baseline Code (Kudos!!)
- https://github.com/JiahuiYu/generative_inpainting - Main Code
- JiahuiYu/generative_inpainting#62 - Model suggestions
- https://github.com/pfnet-research/sngan_projection/blob/master/updater.py#L21 - Hinge Loss
- https://github.com/shepnerd/inpainting_gmcnn/blob/master/tensorflow/net/ops.py - Mask Generator Function