luca-martial commited on
Commit
44a5020
1 Parent(s): 8e7e8df
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,8 +15,8 @@ def tensor_to_image(tensor):
15
  return PIL.Image.fromarray(tensor)
16
 
17
  def stylize(content_image, style_image):
18
- content_image = content_image.astype(np.float32) / 255.
19
- style_image = style_image.astype(np.float32) / 255.
20
 
21
  outputs = hub_module(tf.constant(content_image), tf.constant(style_image))
22
  stylized_image = outputs[0]
 
15
  return PIL.Image.fromarray(tensor)
16
 
17
  def stylize(content_image, style_image):
18
+ content_image = content_image.astype(np.float32)[np.newaxis, ...] / 255.
19
+ style_image = style_image.astype(np.float32)[np.newaxis, ...] / 255.
20
 
21
  outputs = hub_module(tf.constant(content_image), tf.constant(style_image))
22
  stylized_image = outputs[0]