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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| tfhub-styletransfer-wrapper-1.1.3.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|