Skip to content
Switch branches/tags

Latest commit

* initial CLI implementation (#542)

* add documentation for CLI (#543)

* add documentation for CLI

* fix gallery tests dependencies

* rename template

* make paths absolute

* add minimal tests for CLI (#549)

* add help to CLI options (#545)

* add help for CLI options

* cleanup

* add smoke test for CLI (#554)

* add verbose option to CLI (#553)

* add verbose option to CLI

* add tests

* improve error message for bad devices (#559)

* improve error message for bad MLEs (#560)

* improve error message for bad image inputs (#561)

* improve loss handling for CLI (#562)

* improve CLI error message for unknown layers (#564)

* Speed up CLI tests by caching MLE loading (#565)

* Revert "Speed up CLI tests by caching MLE loading (#565)"

This reverts commit 006e88a.

* add remaining CLI tests (#567)

* add more tests for images

* add more tests for MLE

* add more tests for layers

* add more tests for loss

* add more tests for num steps

* add test for output image

* cleanup

* [DEBUG] increase pytest verbosity

* [DEBUG] fix syntax

* [DEBUG] change python test version from 3.6 to 3.9

* [DEBUG] run only failing test

* [DEBUG] run only failing test class

* [DEBUG] run only failing test module

* [DEBUG] check if error is a due to insufficient memory

* revert debug changes

Git stats


Failed to load latest commit information.
Latest commit message
Commit time
package License Project Status: Active
citation pyOpenSci JOSS
code black mypy Lint status via GitHub Actions
tests Test status via GitHub Actions Test coverage
docs Docs status via GitHub Actions Latest documentation hosted on Read the Docs

pystiche logo


pystiche (pronounced /ˈpaɪˈstiʃ/ ) is a framework for Neural Style Transfer (NST) built upon PyTorch. The name of the project is a pun on pastiche meaning:

A pastiche is a work of visual art [...] that imitates the style or character of the work of one or more other artists. Unlike parody, pastiche celebrates, rather than mocks, the work it imitates.

pystiche banner

pystiche has similar goals as Deep Learning (DL) frameworks such as PyTorch:

  1. Accessibility
    Starting off with NST can be quite overwhelming due to the sheer amount of techniques one has to know and be able to deploy. pystiche aims to provide an easy-to-use interface that reduces the necessary prior knowledge about NST and DL to a minimum.
  2. Reproducibility
    Implementing NST from scratch is not only inconvenient but also error-prone. pystiche aims to provide reusable tools that let developers focus on their ideas rather than worrying about bugs in everything around it.


pystiche is a proper Python package and can be installed with pip. The latest release can be installed with

pip install pystiche


pystiche makes it easy to define the optimization criterion for an NST task fully compatible with PyTorch. For example, the banner above was generated with the following criterion:

from pystiche import enc, loss

mle = enc.vgg19_multi_layer_encoder()

perceptual_loss = loss.PerceptualLoss(
        ("relu1_1", "relu2_1", "relu3_1", "relu4_1", "relu5_1"),
        lambda encoder, layer_weight: ops.GramOLoss(
            encoder, score_weight=layer_weight

For the full example, head over to the example NST with pystiche.



or anything else, head over to the documentation.


If you use this software, please cite it as

  author  = {Meier, Philip and Lohweg, Volker},
  journal = {Journal of Open Source Software {JOSS}},
  title   = {pystiche: A Framework for Neural Style Transfer},
  year    = {2020},
  doi     = {10.21105/joss.02761},