Skip to content

lewkesy/Partial-Harmonization-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Partial-Harmonization-Network

This project is an implementation practice of paper Deep Painterly Harmonization. This network allows you to copy and paste some part of image element from other image to your target image and smooth the artifacts, such as:

0 1

Only the first step is implemented owing the time limitation. I will finish the second part after current research work.

Owing to the limitation of memory and GPU, I cannot reconstruct a large image. Please check the code and select the suitable size of output.

Setup

  • python 3.x
  • Tensorflow
  • Keras

Before Training

Before reconstructing the image, you should send the materials requied by the training process. Samples of data organization can be finded in input/painting/xxx/

  • Pasted input, which is shown above.
  • bw_mask, which tells the network which part is the target and which part is the resource.
  • backgound, the original image

Training

To run the training, directly run the code paint-train.py. You would like to check the code and switch the path of your dataset. Assuming that you have installed all the required libs and your Keras has the pretrained VGG-19 model.

python paint-train.py

Results

These results can be checked in "input/painting". The left image is the original background, the mid one is the copy-and-paste input, and the right one is the reconstructed image. Considering that the results are generated through first step, the results will not be satisfying enough. Also the size of results will be small owing to the limitation of memory and GPU. You can modify the size of output in code and I will try to implement the second part later.

bg1 2 3
bg2 4 5

About

Implement practice of paper "Deep Painterly Harmonization"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages