A wrapper that contains quick functions to load and process data with Googles TF Hub v2 fast arbitrary image style transfer model
Project description
TF Hub Wrapper
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.
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
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
Built Distribution
File details
Details for the file tfhub-styletransfer-wrapper-1.1.3.tar.gz
.
File metadata
- Download URL: tfhub-styletransfer-wrapper-1.1.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b910fb6961d86a48d4f236cdfbf24f7848e72748a76e848e5155fcbd8f2d9f6 |
|
MD5 | e6b82975b3e07c1db865bfd4c445a7f6 |
|
BLAKE2b-256 | 88ca1838241ed7c420ad8315c9507297b749652d6844549dad4fe9749fb004f6 |
File details
Details for the file tfhub_styletransfer_wrapper-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: tfhub_styletransfer_wrapper-1.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ae7a33b5330daa6505e5f14b799427425fee27d40641b096507a737824f9c1a |
|
MD5 | 45ead75043b56b086baa2d1065810f51 |
|
BLAKE2b-256 | a4c48572c47aba48bcf68df8d6e2f846b08da963ae4eee202936dcefdb4963c8 |