Skip to content

ceshine/pytorch_style_transfer_l2_wasserstein

Repository files navigation

PyTorch Implementation of Style Transfer as Optimal Transport

Style Transfer as Optimal Transport - Paper and Tensorflow Implementation

(I'm not able to provide a open-source license because the original author did not provide a license, and I used some of his code in this implementation.)

Environment

  • This project is currently tested against pytorch-nightly-1.0.0.dev20181008 (Pytorch 1.0.0 Preview) from conda pytorch channel and torchvision from Github master branch.
  • A Dockerfile is also provided.
  • It uses CUDA by default.

Using Docker

You'll need to install nvidia-docker for GPU acceleration.

Build the Docker Image with the accompanied Dockerfile, and use docker run to start a container.

An example (assuming the image name is pytorch_nightly:latset and the working directory is the root of the project.):

docker run --runtime=nvidia -ti -v (pwd):/home/docker --rm pytorch_nightly:latest bash

Using Conda

Please refer to the conda and pip installation commands in the Dockerfile to replicate the Python environment.

Using Pip & Other Methods

You'll have to build the latest PyTorch from source or use an older PyTorch version. I cannot guarantee it will work, though.

CLI Usage Example

python cli.py --subject content_images/wave_small.jpg --style style_images/kngwa_small.jpg --output wave_kngwa.jpg --steps 100 --log_interval 10

Demo

The Great Wave off Kanagawa

The Great Wave

wave_kngwa

Ribbon Mossaic

Ribbon Mossaic

wave_mossaic

About

PyTorch Implementatino of Style Transfer as Optimal Transport

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published