Giter Club home page Giter Club logo

pystiche's Introduction

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

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, ops

multi_layer_encoder = enc.vgg19_multi_layer_encoder()

criterion = loss.PerceptualLoss(
    content_loss=ops.FeatureReconstructionOperator(
        multi_layer_encoder.extract_encoder("relu4_2")
    ),
    style_loss=ops.MultiLayerEncodingOperator(
        multi_layer_encoder,
        ("relu1_1", "relu2_1", "relu3_1", "relu4_1", "relu5_1"),
        lambda encoder, layer_weight: ops.GramOperator(
            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},
}

pystiche's People

Contributors

pmeier avatar jbueltemeier avatar sourcery-ai[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.