Skip to content

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.

License

Notifications You must be signed in to change notification settings

alex-parisi/tfhub-styletransfer-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TF Hub Wrapper - Style Transfer

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

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages