Skip to main content

TF Hub Wrapper

Latest Release License
This package contains functions to properly load and process images for input to Google's TensorFlow Hub v2 model for fast arbitrary image style transfer and obtain a style-transferred output image. Example Output

Usage:

First, install the package with pip:

pip install tfhub-styletransfer-wrapper

Then import the package:

from tfhub_styletransfer_wrapper import StyleHub

And call the hub evaluation function:

stylehub = StyleHub()
stylehub.load_content(content_image_filename, 512)
stylehub.load_style(style_image_filename, 256)
stylized_image = stylehub.evaluate(True)

This will "re-draw" the input image specified by "input_image.jpg" in a style similar to that found in the image specified by "style_image.jpg".

Note that while different style sizes can be used, the TensorFlow Hub v2 model was trained on 256x256 images, so increasing the style_size parameter any higher than 256 is not recommended.

More examples

Example Output Example Output

Release files for tfhub-styletransfer-wrapper 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfhub-styletransfer-wrapper 1.1.3
File Size Uploaded
tfhub-styletransfer-wrapper-1.1.3.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tfhub-styletransfer-wrapper 1.1.3
File Interpreter ABI Platform
tfhub_styletransfer_wrapper-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / tfhub-styletransfer-wrapper-1.1.3.tar.gz

Download URL tfhub-styletransfer-wrapper-1.1.3.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5b910fb6961d86a48d4f236cdfbf24f7848e72748a76e848e5155fcbd8f2d9f6
BLAKE2b-256 checksum
How to use checksums
88ca1838241ed7c420ad8315c9507297b749652d6844549dad4fe9749fb004f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

Release files / tfhub_styletransfer_wrapper-1.1.3-py3-none-any.whl

Download URL tfhub_styletransfer_wrapper-1.1.3-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ae7a33b5330daa6505e5f14b799427425fee27d40641b096507a737824f9c1a
BLAKE2b-256 checksum
How to use checksums
a4c48572c47aba48bcf68df8d6e2f846b08da963ae4eee202936dcefdb4963c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page