Skip to content
Code for "Stable and Controllable Neural Texture Synthesis and Style Transfer Using Histogram Losses"
HTML Python Cuda C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dst
src
README.md
_config.yml
histogram.cpp
histogram.cu
index.html
main.py

README.md

NeuralTextureSynthesis

Code for "Stable and Controllable Neural Texture Synthesis and Style Transfer Using Histogram Losses"

Notes:

  • The histogram functionality relies on a custom cuda module, so you'll need a cuda GPU to run the code.
  • Tested on GTX1080, top VRAM usage is just under 2700MB, runtime is 10 mins per image.
  • Code differs from the paper as the loss balancing is done with "magic numbers" rather than using the gradient clipping described in the paper.
  • Code doesn't implement the TV loss (total variation), as results didn't appear to have high frequency noise.

Usage:

The code contains a custom C++/Cuda module that gets compiled on the fly, in order to do that you need to use the same compiller as the one used to compile your release of PyTorch. On my machine, that's g++.

To launch the program : CXX=g++ python main.py src/*

This will run all images in src folder with and without histogram and generate a results.html page.

Sample results:

https://pierre-wilmot.github.io/NeuralTextureSynthesis/

You can’t perform that action at this time.