Skip to content

The official implementation of papers: (1) Arbitrary Style Transfer Using Neurally-Guided Patch-Based Synthesis and (2) Enhancing Neural Style Transfer using Patch-Based Synthesis

Notifications You must be signed in to change notification settings

PeterZhouSZ/Neurally-Guided-Style-Transfer

Repository files navigation

Neurally-Guided-Style-Transfer

The official implementation of algorithms described in papers:

(1) Arbitrary Style Transfer Using Neurally-Guided Patch-Based Synthesis
O. Texler, D. Futschik, J. Fišer, M. Lukáč, J. Lu, E. Shechtman, and D. Sýkora
[WebPage], [Paper], [BiBTeX]

(2) Enhancing Neural Style Transfer using Patch-Based Synthesis
O. Texler, J. Fišer, M. Lukáč, J. Lu, E. Shechtman, and D. Sýkora
[WebPage], [Paper], [Slides]

Build

On Windows

On Linux

  • Download and build OpenCV 4.2.0 (https://opencv.org/opencv-4-2-0/)
  • Copy libopencv_world.so, libopencv_world.so.4.2, and libopencv_world.so.4.2.0 to the opencv-4.2.0/lib
  • Do not forget to update your LD_LIBRARY_PATH to point to the opencv-4.2.0/lib
  • Run build-linux.sh, it should output styletransfer

Parameters

  • --style <string>, mandatory, path to the style image
  • --neural_result <string>, mandatory, path to the neural result
  • --out_path <string>, optional, output path, if not specified --neural_result+"_enhanced.jpg" is used instead
  • --target <string>, optional, has to be specified if you want to use --guide_by_target or --recolor_by_target
  • --guide_by_target <bool>, optional, might help to restore some content of the target image, but also might make the result worse stylization-wise (target has to be perfectly aligned with neural_result)
  • --recolor_by_target <bool>, optional, recolor the final result to have similar colors as the target image
  • --patch_based_source_blur <int>, optional, specify how much the result is abstract
  • --patch_based_style_weight <float>, optional, specify whether to follow style or content during the patch based synthesis
  • --patch_based_max_mp <float>, optional, defines the maximal resolution (in megapixels) on which the patch based synthesis runs
  • --patch_based_backend <string>, optional, values are "CPU", "GPU" or "AUTO"

Examples

  • Once compiled successfully, check and run examples/wolf/run.bat or examples/wolf/run.sh
  • The result image should appear next to the scripts

Citing Neurally-Guided-Style-Transfer

If you find Neurally-Guided-Style-Transfer usefull for your research or work, please use the following BibTeX entry.

@ARTICLE{Texler20-CAG,
  author  = {Ond\v{r}ej Texler and David Futschik and Jakub Fi\v{s}er and Michal Luk\'{a}\v{c} 
               and Jingwan Lu and Eli Shechtman and Daniel S\'{y}kora},
  journal = "Computers \& Graphics",
  title   = {Arbitrary Style Transfer Using Neurally-Guided Patch-Based Synthesis},
  year    = {2020},
}

About

The official implementation of papers: (1) Arbitrary Style Transfer Using Neurally-Guided Patch-Based Synthesis and (2) Enhancing Neural Style Transfer using Patch-Based Synthesis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages