Two-Stage Coarse-Fine-Separated Image Inpainting Network with Gated Attention (嵌入门控注意力的二阶段粗精分离图像修复模型 )
- Python 3.6
- PyTorch 1.2
- NVIDIA GPU + CUDA cuDNN
- Some other frequently-used python packages, like opencv, numpy, imageio, etc.
We use CelebA, Paris Street View datasets.
The irregular mask dataset is available from here.
After Downloading images and masks, create .filst file containing the dataset path in ./datasets/
(some examples have been given, refer to so).
Download pretrained models from my OneDrive, and place .pth files in the ./checkpoints
directory.
Please edit the config file ./config.yml
for your training setting.
The options are all included in this file, see comments for the explanations.
Once you've set up, run the ./train.py
script to launch the training.
python train.py
Download pretrained models as said above, use ./test.py
for testing:
python test.py
--G1 <path to generator 1>
--G2 <path to generator 2>
--input <path to input images>
--mask <path to masks>
--output <path to results directory>
Alternatively, you can also edit these options in the config file ./config.yml
.