luca-martial's picture
init
040810d
raw
history blame
No virus
433 Bytes
import gradio as gr
import tensorflow as tf
import tensorflow_hub as hub
hub_model = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
def stylize(content_image, style_image):
stylized_image = hub_model(tf.constant(content_image), tf.constant(style_image))[0]
return tensor_to_image(stylized_image)
iface = gr.Interface(fn=stylize, inputs=["image", "image"], outputs="image")
iface.launch()