Giter VIP home page Giter VIP logo

gin's Introduction

Deep Generative Inpainting Network (GIN) for Extreme Image Inpainting

For AIM2020 ECCV Extreme Image Inpainting Track 1 Classic
This is the Pytorch implementation of our Deep Generative Inpainting Network (GIN) for Extreme Image Inpainting. We have participated in AIM 2020 ECCV Extreme Image Inpainting Challenge. Our GIN is used for reconstructing a completed image with satisfactory visual quality from a randomly masked image.

Overview

Our Spatial Pyramid Dilation (SPD) block

Example of Image Inpainting using our GIN

  • An example from the validation set of the AIM20 ECCV Extreme Image Inpainting Track 1 Classic
  • (left: masked image, right: our completed image)

Preparation

  • Our solution is developed using Pytorch 1.5.0 platform
  • We train our model on two NVIDIA GeForce RTX 2080 Ti (with 11GB memory)
  • Apart from Pytorch and related dependencies,
  • Install natsort
pip install natsort
  • Install dominate
pip install dominate
  • Install scipy 1.1.0
pip install scipy==1.1.0
  • If you would like to use tensorboard for logging, please also install tensorboard and tensorflow
  • Please clone this project:
git clone https://github.com/rlct1/gin.git
cd gin

Testing

  • An example of the validation data of this challenge is provided in the datasets/ade20k/test folder
  • Please download our trained model for this challenge here (google drive link), and put it under checkpoints/gin/
  • For reproducing the test results for this challenge, please put all the testing images under datasets/ade20k/test/
  • You can test our model by typing:
python test_ensemble.py --name gin 
  • The test results will be stored in results/test folder
  • If you would like to test on other datasets, please refer to the file structure in the datasets/ade20k/test folder
  • Note that the file structure is for AIM20 IC Track 1
  • You can download our test results for this challenge here (google drive link)

Training

  • By default, our model is trained using two GPUs
  • Examples of the training images from this challenge is provided in the datasets/ade20k/train folder
  • If you would like to train a model using our warm up for initialization, please download our warm up for this challenge here (google drive link), and put it under checkpoints/warmup/
python train.py --name yourmodel --continue_train --load_pretrain './checkpoints/warmup' 
  • If you would like to train a model from scratch,
python train.py --name yourmodel 
  • If you would like to train a model based on your own selection and resources, please refer to the options/base_options.py and options/train_options.py for details

Experiments

Ablation Study

Comparisons

Visualization of predicted semantic segmentation map

Citation

Thanks for visiting our project page, if it is useful, please cite our paper,

@misc{li2020deepgin,
    title={DeepGIN: Deep Generative Inpainting Network for Extreme Image Inpainting},
    author={Chu-Tak Li and Wan-Chi Siu and Zhi-Song Liu and Li-Wen Wang and Daniel Pak-Kong Lun},
    year={2020},
    eprint={2008.07173},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

Acknowledgment

Our code is developed based on the skeleton of the Pytorch implementation of pix2pixHD

gin's People

Contributors

rlct1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gin's Issues

Loss is not converge

Hi,
I have tried your inpainting model and it is very impressive.

However, when I clone your code and try to train by myself, the loss become larger and larger after a few epochs (2~10, randomly)
I try to train from your warmup model with the same dataset(ade20k) and default parameters. But the result is still the same...

Did I do anything wrong?
Could you give me some advice to avoid this situation?
Thanks.

Question about license

Dear authors,

I have tried your inpainting model on my data and the result was impressive.
Thank you for sharing the great work.

By the way, this repository is not licensed.
Would you tell me if you are going to add license in the future?

Best,
Kodai

Question about post-processing of inference result

Dear Mr. Ron

In test_emsemble.py at line 169 and 170, result image is resized to half and then doubled the size.
I think this operation should usually degrade the image quality.
Would you tell me why this operation is added to post-processing?

Best,
Kodai

D_fake loss and D_real loss do not converge

                          Dear authors,

Thank you very much for sharing your codes, and congratulations on the great achievement. I have tried to run your codes on my own dataset. However, D_fake loss and D_real loss do not converge. Their values remain around 1. 922 and 2. 021. I have even increased the epoch number to 140, assigned different values to the style loss, tv loss, l1 loss and learning rate, etc. There was no improvement. Please, how can I fix this? Has anyone encountered the same problem?

Any suggestions or comments would be highly appreciated.

Kind regards,
Patrice

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.