This repository contains the implmentation Image Inpainting method proposed in the paper
Gourav Wadhwa, Abhinav Dhall, Subrahmanyam Murala, and Usman Tariq, Hyperrealistic Image Inpainting with Hypergraphs.In IEEE Winter Conference on Computer Vision (WACV), 2021.
Paper | Supplementary Material | BibTex
- Python 3.5 or higher
- Tensorflow 2.x (tested on 2.0.0, 2.1.0, 2.2.0)
- Numpy
- Pillow
- Matplotlib
- tqdm
- OpenCV
- Scipy
We use a two stage coarse-to-refine network for the task of image inpainting
git clone https://github.com/GouravWadhwa/Hypergraphs-Image-Inpainting.git
cd Hypergraphs-Image-Inpainting
Download the pretrained models from the following links
- CelebA-HQ (Center Mask, Random Mask)
- Places2 (Center Mask, Random Mask)
- Paris Street View (Center Mask, Random Mask)
- Facades Dataset (Center Mask, Random Mask)
Put the checkpoints in the folder pretrained_models/
. To test images in a folder, specify the path to the folder using --test_dir
and specify the model to be loaded using --checkpoint_prefix
.
For example (for CelebA-HQ dataset on Random Mask) :
python test.py --dataset celeba-hq --pretrained_model_dir pretrained_models/ --checkpoint_prefix celeba_hq_256x256_random_mask --random_mask 1 --test_dir [Testing Folder Path]
Note - For all predicted images, 1st image represent the input image, 2nd represent the ground truth, 3rd represents the coarse network output and the final image is our final prediction.
You can use evaluate.py
to determine SSIM and PSNR of the predicted images.
If you find this work useful or gives you some insights, please cite:
@InProceedings{Wadhwa_2021_WACV,
author={Wadhwa, Gourav and Dhall, Abhinav and Murala, Subrahmanyam and Tariq, Usman},
title={Hyperrealistic Image Inpainting With Hypergraphs},
booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
month={January},
year={2021},
pages={3912-3921}
}
For any further queries please contact at [email protected] (The code is under development.)