Coder Social home page Coder Social logo

mural-image-inpainting's Introduction

Line Drawing Guided Progressive Inpainting of Mural Damages - MuralNet

This is the source code for 'Line Drawing Guided Progressive Inpainting of Mural Damages'. We provide the code, the dataset, and the pretrained models. For convienence of introduction, we name the proposed network as MuralNet.

Abstract:

Mural image inpainting refers to repairing the damage or missing areas in a mural image to restore the visual appearance. Most existing image-inpainting methods tend to take a target image as the only input and directly repair the damage to generate a visually plausible result. These methods obtain high performance in restoration or completion of some specific objects, e.g., human face, fabric texture, and printed texts, etc., however, are not suitable for repairing murals with varied subjects, especially for murals with large damaged areas. Moreover, due to the discrete colors in paints, mural inpainting may suffer from apparent color bias as compared to natural image inpainting. To this end, in this paper, we propose a line drawing guided progressive mural inpainting method. It divides the inpainting process into two steps: structure reconstruction and color correction, executed by a structure reconstruction network (SRN) and a color correction network (CCN), respectively. In the structure reconstruction, line drawings are used by SRN as a guarantee for large-scale content authenticity and structural stability. In the color correction, CCN operates a local color adjustment for missing pixels which reduces the negative effects of color bias and edge jumping. The proposed approach is evaluated against the current state-of-the-art image inpainting methods. Qualitative and quantitative results demonstrate the superiority of the proposed method in mural image inpainting.

-Mural image inpainting, -Mural damage repair, -Line drawing guided image inpainting

Mural Inpainting with and without line drawings

image

Network Architecture

image

Set up:

Requirments

  • Python 3.7
  • PyTorch 1.6
  • We run the codes on NVIDIA GPU RTX2080ti with CUDA 10.2 and cuDNN 7.6.5

Preparation:

Data Preparation

image We collected a mural dataset DhMural1714 to train and test the MuralNet. You can download them and put them into "./dataset/".

Pretrained Models

Our model is pretrained on DhMural1714, the pretrained model can be obtained at ./checkpoints/InpaintingModel_gen.pth and ./checkpoints/InpaintingModel_dis.pth

Download:

DhMural1714 Dataset

In our research, we collected some replicas of murals by artists in addition to the real mural paintings. The real mural paintings are captured by digital cameras, while the replicas of murals are obtained by scanning the album. A total of 1,714 images are collected. Among them, there are 525 real murals and 1,189 replicas.

dataset: https://1drv.ms/u/s!AittnGm6vRKLzXorf1nkiDPRQB4D?e=Avv27i

You can also download the dataset from
Link: https://pan.baidu.com/s/13dkh4zX3C4_z2W3Kigg6uQ passcodes: 0vlr

Pretrained Models

You can also download the pretrained models from
link: https://pan.baidu.com/s/1EKvTAHyOaMbL9s7aqdZEfw passcodes: vg5v

Training:

MuralNet is trained on two stages: 1) training the coarse network, 2) training the whole model.

To train the model, modify the training parameters in checkpoints/config.yml.

Run the code for training:

python train.py

Test:

We provide several example images in checkpoints/test for testing, just run the code:

python test.py

Directory of testing images can be modified in main.py, the network requires the input images, the corresponding line drawings, and the masks for inpainting.

image

Evaluation:

To evaluate the performance, run the code:

python eval_mix.py

Acknowledgment:

We implement our method by referring to EdgeConnect. We thank the authors of the EdgeConnect paper. If you use this code in your work, you should also cite the EdgeConnect paper.

@inproceedings{nazeri2019edgeconnect,
  title={EdgeConnect: Generative Image Inpainting with Adversarial Edge Learning},
  author={Nazeri, Kamyar and Ng, Eric and Joseph, Tony and Qureshi, Faisal and Ebrahimi, Mehran},
  journal={arXiv preprint},
  year={2019},
}

mural-image-inpainting's People

Contributors

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