/APLRL

Primary LanguagePython

Adaptive Prior and Long-Range Dependency-Based Learners for Image Inpainting

This is the official PyTorch implementation of APLRL.

Prerequisites

  • Python 3.7
  • PyTorch 1.2
  • NVIDIA GPU + CUDA cuDNN

Installation

  • Install python requirements:
pip install -r requirements.txt

Datasets

Image Dataset. We evaluate the proposed method on the CelebA, Paris StreetView, and Places2 datasets, which are widely adopted in the literature.

Mask Dataset. Irregular masks are obtained from Irregular Masks and classified based on their hole sizes relative to the entire image with an increment of 10%.

Getting Started

Download the pre-trained models using the following links and copy them under ./snapshots directory.

Places2 | CelebA | Paris-StreetView

Testing

To test the model, you run the following code.

python test.py \
  --pre_trained [path to checkpoints] \
  --image_root [path to image directory] \
  --mask_root [path to mask directory] \
  --result_root [path to output directory] \
  --number_eval [number of images to test]

Acknowledgements

Some of the code of this repo is borrowed from: