Coder Social home page Coder Social logo

deepfillv2_pytorch's Introduction

DeepFillv2_Pytorch

This is a Pytorch re-implementation for the paper Free-Form Image Inpainting with Gated Convolution.

This repository contains "Gated Convolution", "Contextual Attention" and "Spectral Normalization".

Requirement

  • Python 3
  • OpenCV-Python
  • Numpy
  • Pytorch 1.0+

Compared Results

The following images are Original, Masked_orig, Official(Tensorflow), MMEditing(Pytorch), Ours(Pytorch).

1_compare

2_compare

3_compare

4_compare

5_compare

6_compare

Dataset

Training Dataset

The training dataset is a collection of images from Places365-Standard which spatial sizes are larger than 512 * 512. (It will be more free to crop image with larger resolution during training)

Testing Dataset

Create the folders test_data and test_data_mask. Note that test_data and test_data_mask contain the image and its corresponding mask respectively.

Training

  • To train a model:
$ bash ./run_train.sh

All training models and sample images will be saved in ./models/ and ./samples/ respectively.

Testing

Download the pretrained model here and put it in ./pretrained_model/.

  • To test a model:
$ bash ./run_test.sh

Acknowledgments

The main code is based upon deepfillv2.
The code of "Contextual Attention" is based upon generative-inpainting-pytorch.
Thanks for their excellent works!
And Thanks for Kuaishou Technology Co., Ltd providing the hardware support to this project.

Citation

@article{yu2018generative,
  title={Generative Image Inpainting with Contextual Attention},
  author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
  journal={arXiv preprint arXiv:1801.07892},
  year={2018}
}

@article{yu2018free,
  title={Free-Form Image Inpainting with Gated Convolution},
  author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
  journal={arXiv preprint arXiv:1806.03589},
  year={2018}
}

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.