GithubHelp home page GithubHelp logo

imageinpainting's Introduction

ImageInpainting

An official implementation code for paper "Deep Generative Model for Image Inpainting with Local Binary Pattern Learning and Spatial Attention"

Table of Contents

Background

Inpainting results generated by our proposed model. In each pair, the upper is the input image with irregular or centering mask, and the bottom is the inpainting result.

In this paper, we have proposed a deep generative model for image inpainting with Local Binary Pattern (LBP) learning and a new spatial attention mechanism. The proposed model has been formed with two networks: a LBP learning network, which aims to learn the LBP feature of the missing region, and an image inpainting network, which generates the inpainting results by using the learned LBP as a guidance. Furthermore, we have designed a new spatial attention layer, and have incorporated it into the image inpainting network. The proposed spatial attention strategy not only considers the dependency between the know region and the filled region, but also the one within the filled region.

Overview of our proposed generative inpainting network.

An example of our spatial attention layer.

Dependency

  • torch 1.6.0

Demo

To train or test the proposed model:

python main.py {train,test}

For example to test the proposed model:

python main.py test

Then the model will inpaint the images in the ./demo/input/ with corresponding masks in the ./demo/mask/ and save the results in the ./demo/output/ directory. The pre-trained weights should be put in the ./weights/ directory.

Note: The pretrained weights can be downloaded from: Google Drive or Baidu Yun (Code: a6n2)

Citation

If you use this code for your research, please cite our paper

@ARTICLE{9537606,
author={Wu, Haiwei and Zhou, Jiantao and Li, Yuanman},
journal={IEEE Transactions on Multimedia}, 
title={Deep Generative Model for Image Inpainting with Local Binary Pattern Learning and Spatial Attention}, 
year={2021},
volume={},
number={},
pages={1-1},
doi={10.1109/TMM.2021.3111491}}

Acknowledgments

Our code is based on the Shift-Net.

imageinpainting's People

Contributors

highwaywu 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.