November 4, 2019

229 words 2 mins read



Style Transfer by Relaxed Optimal Transport and Self-Similarity (CVPR 2019)

repo name nkolkin13/STROTSS
repo link
language Python
size (curr.) 3381 kB
stars (curr.) 181
created 2019-04-29

Style Transfer by Relaxed Optimal Transport and Self-Similarity (STROTSS)

Code for the paper, to appear CVPR 2019

Webdemo available at:


  • python3 >= 3.5
  • pytorch >= 1.0
  • imageio >= 2.2
  • numpy >= 1.1


Unconstrained Style Transfer:


The default content weight is 1.0 (for the images provided my personal favorite is 0.5, but generally 1.0 works well for most inputs). The content weight is actually multiplied by 16, see section 2.5 of paper for explanation.

The resolution of the output can be set on line 80 of; the current scale is 5, and produces outputs that are 512 pixels on the long side, setting it to 4 or 6 will produce outputs that are 256 or 1024 pixels on the long side respectively, most GPUs will run out of memory for settings of this variable above 6.

The output will appear in the same folder as ‘’ and be named ‘output.png’

Spatially Guidaed Style Transfer:


guidance should take the form of two masks such as these:

Content Mask Style Mask

where regions that you wish to map onto each other have the same color.

comments powered by Disqus