"A Context-Based Multi-Scale Discriminant Model for Natural Image Inpainting".
It is a model for inpainting task, which is based on GL and NIN.
- [Required] Pretrained generator model (Completion Network): Baidu NetDisk. (key: 1234)
- [Optional] Pretrained discriminator model (Context Discriminator): Baidu NetDisk. (key: 5678)
Note that you don't need the dicriminator model for inference because only generator is necessary to perform image completion.
Both the generator and discriminator were trained on the CelebA.
Example:
# in {path_to_this_repo}/,
$ python predict.py model_cn config.json images/test.jpg output.jpg
One can also train the network with their own datasets, by modifying the data path in config.json
.
Here we offer some official links used in paper.
- CelebA
- DeepFashion
- Imagenet
- LSUN
- ParisStreet View (Request permission through e-mail)
Process the data by running ./datasets/make_dataset.py
.
Example:
# in {path_to_this_repo}/,
$ python python train.py datasets/img_align_celeba results/wc/
Training results (trained model snapshots and inference results) are to be saved in ./results/wc
.
The training procedure consists of the following three phases.
- In phase 1, only Completion Network (i.e., generator) is trained.
- In phase 2, only Context Discriminator (i.e., discriminator) is trained, while Completion Network is frozen.
- In phase 3, Both of the networksd are jointly trained.
By default, the training steps during phase 1, 2, and 3 are set to 90,000, 10,000, and 400,000, respectively.
One can also customize their training settings in ./config.json
.
For more results and models during training, click here. (key: 6666)
Please contact me if there is any question. (Chao Wang oliversavealien@gmail.com)