Transfer the style of one image to another using PyTorch
Project description
styletransfer
A Python library to transfer the style of one picture to another using PyTorch.
Installation
You can install styletransfer from PyPi using:
pip install styletransfer
This package requires Python 3.x
Basic usage
The easiest way to get started is taking an online image for style transfer and just running with the default parameters:
from styletransfer import StyleTransfer
styleTransfer = StyleTransfer()
#Set the content image from URL
styleTransfer.setContentFromUrl('https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Felis_silvestris_catus_lying_on_rice_straw.jpg/640px-Felis_silvestris_catus_lying_on_rice_straw.jpg')
#Set the style image from URL
styleTransfer.setStyleFromUrl('https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Tsunami_by_hokusai_19th_century.jpg/640px-Tsunami_by_hokusai_19th_century.jpg')
#Use default settings and train the model
#If you do not have a GPU that can take 30-60 minutes
styleTransfer.apply()
#Write the result image to a file
styleTransfer.writeFinalImage('stylized_image.jpg')
Advanced usage
TBD: Detailed instructions to follow
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
styletransfer-0.8.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for styletransfer-0.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87dd38433179701f5b6a69b56d59165e4f8d1eb78414374349a7b30dc05389f2 |
|
MD5 | d75ec52683be992fc28524749cf67ed4 |
|
BLAKE2b-256 | e4f17d0a735f86c81457d092043e9dd12aa235e4eee37e9b6253215ef7fe94ff |