Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ radio_style = gr.Radio(style_images, label="Choose Style")
|
|
45 |
def perform_neural_transfer(content_image_input, style_image_input):
|
46 |
|
47 |
content_image = content_image_input.astype(np.float32)[np.newaxis, ...] / 255.
|
48 |
-
content_image = tf.image.resize(content_image, (
|
49 |
|
50 |
style_image_input = style_urls[style_image_input]
|
51 |
style_image_input = plt.imread(style_image_input)
|
@@ -56,7 +56,7 @@ def perform_neural_transfer(content_image_input, style_image_input):
|
|
56 |
hub_module = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
|
57 |
|
58 |
outputs = hub_module(tf.constant(content_image), tf.constant(style_image))
|
59 |
-
stylized_image = outputs[0]
|
60 |
|
61 |
return tensor_to_image(stylized_image)
|
62 |
|
|
|
45 |
def perform_neural_transfer(content_image_input, style_image_input):
|
46 |
|
47 |
content_image = content_image_input.astype(np.float32)[np.newaxis, ...] / 255.
|
48 |
+
content_image = tf.image.resize(content_image, (600, 400))
|
49 |
|
50 |
style_image_input = style_urls[style_image_input]
|
51 |
style_image_input = plt.imread(style_image_input)
|
|
|
56 |
hub_module = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
|
57 |
|
58 |
outputs = hub_module(tf.constant(content_image), tf.constant(style_image))
|
59 |
+
stylized_image = outputs[0]
|
60 |
|
61 |
return tensor_to_image(stylized_image)
|
62 |
|