项目作者: moritztng

项目描述 :
High Resolution Style Transfer in PyTorch with Color Control and Mixed Precision :art:
高级语言: Python
项目地址: git://github.com/moritztng/prism.git
创建时间: 2020-09-18T13:35:12Z
项目社区:https://github.com/moritztng/prism

开源协议:MIT License

下载


Installation

  1. pip install git+https://github.com/moritztng/prism.git

Quickstart

Open in Colab
Read the Docs

Minimal Example

  1. style-transfer content.jpg style.jpg

Complex Example

  1. style-transfer content.jpg style.jpg --artwork artwork.png --style_weight 1000 --lr 1 --iter 500

Content
Style

Artwork

Features

High Resolution

  1. # Create low-resolution artwork with area of 512 * 512.
  2. style-transfer content.jpg style.jpg
  3. # Initialize with low-resolution artwork to create artwork with area of 1024 * 1024.
  4. style-transfer content.jpg style.jpg --init_img artwork.png --area 1024 --iter 200

Mixed Precision

Faster training, less memory, same quality on GPUs.

  1. style-transfer content.jpg style.jpg --use_amp

Preserve Content Color

  1. style-transfer content.jpg style.jpg --preserve_color content

Python Object

  1. from PIL import Image
  2. from style_transfer.learn import StyleTransfer
  3. style_transfer = StyleTransfer()
  4. artwork = style_transfer(Image.open('content.jpg'), Image.open('style.jpg'))
  5. artwork.save('artwork.png')

Shop

The shop was based on this implementation and customers ordered canvas prints there.

https://user-images.githubusercontent.com/19519902/182423297-f9fa1e12-691a-43f3-ab5a-6f51c24161af.mp4

Canvas Prints


Moritz
Max

References