Spaces:
Runtime error
Runtime error
lsquaremaster
commited on
Commit
•
90ba4b1
1
Parent(s):
b3f771e
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ model = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v
|
|
7 |
|
8 |
def style_transfer(content_img, style_img):
|
9 |
content_img = tf.image.resize(tf.convert_to_tensor(content_img,tf.float32)[tf.newaxis,...] / 255.,(512,512),preserve_aspect_ratio=True)
|
10 |
-
style_img = tf.convert_to_tensor(
|
11 |
|
12 |
generated_img = model(content_img, style_img)[0]
|
13 |
return Image.fromarray(np.unit8(generated_img[0]*255))
|
|
|
7 |
|
8 |
def style_transfer(content_img, style_img):
|
9 |
content_img = tf.image.resize(tf.convert_to_tensor(content_img,tf.float32)[tf.newaxis,...] / 255.,(512,512),preserve_aspect_ratio=True)
|
10 |
+
style_img = tf.convert_to_tensor(style_img,tf.float32)[tf.newaxis,...] / 255.
|
11 |
|
12 |
generated_img = model(content_img, style_img)[0]
|
13 |
return Image.fromarray(np.unit8(generated_img[0]*255))
|