Skip to main content

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

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.

Installation

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

pip install pystiche

Usage

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(
    content_loss=loss.FeatureReconstructionLoss(
        mle.extract_encoder("relu4_2")
    ),
    style_loss=loss.MultiLayerEncodingLoss(
        mle,
        ("relu1_1", "relu2_1", "relu3_1", "relu4_1", "relu5_1"),
        lambda encoder, layer_weight: ops.GramOLoss(
            encoder, score_weight=layer_weight
        ),
        score_weight=1e3,
    ),
)

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

Documentation

For

or anything else, head over to the documentation.

Citation

If you use this software, please cite it as

@Article{ML2020,
  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},
}

Metadata

Release files for pystiche 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pystiche 1.0.1
File Size Uploaded
pystiche-1.0.1.tar.gz 61.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystiche 1.0.1
File Interpreter ABI Platform
pystiche-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 128.4 kB

Release files / pystiche-1.0.1.tar.gz

Download URL pystiche-1.0.1.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ca22cb07a46fcf0164127564bcc7ced918d3025d172357e14dbe014236d42f71
BLAKE2b-256 checksum
How to use checksums
4ae67728a6aae6f7d0eb0f33088d7448d0bc49cc4d1584a83035f83502208917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.14

Release files / pystiche-1.0.1-py3-none-any.whl

Download URL pystiche-1.0.1-py3-none-any.whl
Size 67.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac80910e647a747c1a80def19d7406294c1f2aaec6f656ed5949291c43fb4f4f
BLAKE2b-256 checksum
How to use checksums
f95aac09fdb154c9bb3cee88c03e640a584b720253a46aa5b4b77c6a376a61fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.14

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page