shainis commited on
Commit
0daacc3
1 Parent(s): c82d5ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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, (256, 256))
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].resize(outputs[0], (256, 256))
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