Skip to main content

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


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.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

styletransfer-0.8.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file styletransfer-0.8.2.tar.gz.

File metadata

  • Download URL: styletransfer-0.8.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for styletransfer-0.8.2.tar.gz
Algorithm Hash digest
SHA256 a0afe08e4844dc70b4e2ee653d411580aa7db8230c5e44f4c7dfc9e6d5a91eab
MD5 89fe9a7c81d3f3dbffaa5403038ee92a
BLAKE2b-256 10a9359e5ebee17911c64435e2eb721f728c7850cb98d386c3968ed96f88a507

See more details on using hashes here.

File details

Details for the file styletransfer-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: styletransfer-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for styletransfer-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2125e1f2e8448a3271acf20b59831549ac7b081806352578ec1e8e8369b1a437
MD5 daa4e8486fe3f6a544cd31045e86ec1c
BLAKE2b-256 1719613d42071473cff4892a5caeeec31121f2511ad9346176438f96eac286af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page