Giter Club home page Giter Club logo

pytorch-siggraph2017-inpainting's Introduction

PyTorch-SIGGRAPH2017-Inpainting

This is an implementation of Globally and Locally Consistent Image Completion with PyTorch.  
日本語README(追加予定)

Results

gif: input -> masked -> output -> blackout

  • result1
    result1
  • result2
    result2
  • result3
    result3

Requirements

  • Python 3
  • PyTorch
  • NumPy
  • OpenCV
  • pyamg (optional, but required for post-processing)
  • scipy (optional, but required for post-processing)

This code can run without GPU.

Download pre-train model

Download the trained model to the current directory:

wget --continue -O completionnet_places2.t7 http://hi.cs.waseda.ac.jp/~iizuka/data/completionnet_places2.t7

Usage

Basic usage is:

python inpaint.py --input <input_image> --mask <mask_image>

The mask is a Black and White image. White is completed reagion. And, the mask should be the same size as the input image. If the mask is not specified, a mask with randomly generated holes will be used.
Mask example:

Other options:

  • --gpu : Use GPU for the computation, however may not become faster. Defaults to False.
  • --postproc : Able the post-processing(poisson blending). Dafaults to False. This poisson blending script is forked from this repository.

For example:

python inpaint.py --input example.png --mask example_mask.png

Finally, please push this repository Star bottom! Thank you.

Notes

  • This is developed on a Linux machine running Ubuntu 16.04.
  • According to the original paper, this pre-trained model was trained on Places2 dataset and thus performance is for natural outdoor images.
  • This script referenced here and here.

Licence

This work is licensed under the Creative Commons:
  http://creativecommons.org/licenses/by-nc-sa/4.0/

Citation

Please cite the original paper in your publications:

@Article{IizukaSIGGRAPH2017,
  author = {Satoshi Iizuka and Edgar Simo-Serra and Hiroshi Ishikawa},
  title = {{Globally and Locally Consistent Image Completion}},
  journal = "ACM Transactions on Graphics (Proc. of SIGGRAPH)",
  year = 2017,
  volume = 36,
  number = 4,
  pages = 107:1--107:14,
  articleno = 107,
}

pytorch-siggraph2017-inpainting's People

Watchers

James Cloos avatar Joe Stone avatar

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.