Spaces:
Runtime error
Runtime error
Franco Astegiano
commited on
Update tf_hub_fast_style_transfer_for_arbitrary_styles.py
Browse files
examples/colab/tf_hub_fast_style_transfer_for_arbitrary_styles.py
CHANGED
@@ -68,10 +68,6 @@ import numpy as np
|
|
68 |
import tensorflow as tf
|
69 |
import tensorflow_hub as hub
|
70 |
|
71 |
-
print("TF Version: ", tf.__version__)
|
72 |
-
print("TF Hub version: ", hub.__version__)
|
73 |
-
print("Eager mode enabled: ", tf.executing_eagerly())
|
74 |
-
print("GPU available: ", tf.config.list_physical_devices('GPU'))
|
75 |
|
76 |
# @title Define image loading and visualization functions { display-mode: "form" }
|
77 |
|
@@ -115,8 +111,8 @@ def show_n(images, titles=('',)):
|
|
115 |
|
116 |
# @title Load example images { display-mode: "form" }
|
117 |
|
118 |
-
content_image_url = 'https://
|
119 |
-
style_image_url = 'https://
|
120 |
output_image_size = 384 # @param {type:"integer"}
|
121 |
|
122 |
# The content image size can be arbitrary.
|
@@ -165,6 +161,9 @@ stylized_image = outputs[0]
|
|
165 |
|
166 |
show_n([content_image, style_image, stylized_image], titles=['Original content image', 'Style image', 'Stylized image'])
|
167 |
|
|
|
|
|
|
|
168 |
"""## Let's try it on more images"""
|
169 |
|
170 |
# @title To Run: Load more images { display-mode: "form" }
|
@@ -206,4 +205,4 @@ stylized_image = hub_module(tf.constant(content_images[content_name]),
|
|
206 |
tf.constant(style_images[style_name]))[0]
|
207 |
|
208 |
show_n([content_images[content_name], style_images[style_name], stylized_image],
|
209 |
-
titles=['Original content image', 'Style image', 'Stylized image'])
|
|
|
68 |
import tensorflow as tf
|
69 |
import tensorflow_hub as hub
|
70 |
|
|
|
|
|
|
|
|
|
71 |
|
72 |
# @title Define image loading and visualization functions { display-mode: "form" }
|
73 |
|
|
|
111 |
|
112 |
# @title Load example images { display-mode: "form" }
|
113 |
|
114 |
+
content_image_url = 'https://freeimage.host/i/VsCchl' # @param {type:"string"}
|
115 |
+
style_image_url = 'https://freeimage.host/i/VsC5kG' # @param {type:"string"}
|
116 |
output_image_size = 384 # @param {type:"integer"}
|
117 |
|
118 |
# The content image size can be arbitrary.
|
|
|
161 |
|
162 |
show_n([content_image, style_image, stylized_image], titles=['Original content image', 'Style image', 'Stylized image'])
|
163 |
|
164 |
+
|
165 |
+
|
166 |
+
'''
|
167 |
"""## Let's try it on more images"""
|
168 |
|
169 |
# @title To Run: Load more images { display-mode: "form" }
|
|
|
205 |
tf.constant(style_images[style_name]))[0]
|
206 |
|
207 |
show_n([content_images[content_name], style_images[style_name], stylized_image],
|
208 |
+
titles=['Original content image', 'Style image', 'Stylized image'])
|