Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import gradio as gr
|
|
7 |
from PIL import Image
|
8 |
|
9 |
np.set_printoptions(suppress=True)
|
10 |
-
|
11 |
model = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
|
12 |
|
13 |
def tensor_to_image(tensor):
|
@@ -26,16 +25,14 @@ def transform_my_model(content_image, style_image):
|
|
26 |
demo = gr.Interface(
|
27 |
fn=transform_my_model,
|
28 |
inputs=[gr.Image(label="Content Image"), gr.Image(label="Style Image")],
|
29 |
-
outputs=
|
30 |
title="Style Transfer",
|
31 |
-
theme="seafoam",
|
32 |
examples=[
|
33 |
["Content_Images/contnt12.jpg", "VG516.jpg"],
|
34 |
["Content_Images/contnt2.jpg", "Content_Images/styl9.jpg"],
|
35 |
["Content_Images/contnt.jpg", "Content_Images/styl22.jpg"]
|
36 |
],
|
37 |
-
article="References-\n\nExploring the structure of a real-time, arbitrary neural artistic stylization network. Golnaz Ghiasi, Honglak Lee, Manjunath Kudlur, Vincent Dumoulin."
|
38 |
-
share=True
|
39 |
)
|
40 |
|
41 |
-
demo.launch()
|
|
|
7 |
from PIL import Image
|
8 |
|
9 |
np.set_printoptions(suppress=True)
|
|
|
10 |
model = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
|
11 |
|
12 |
def tensor_to_image(tensor):
|
|
|
25 |
demo = gr.Interface(
|
26 |
fn=transform_my_model,
|
27 |
inputs=[gr.Image(label="Content Image"), gr.Image(label="Style Image")],
|
28 |
+
outputs=gr.Image(label="Result"),
|
29 |
title="Style Transfer",
|
|
|
30 |
examples=[
|
31 |
["Content_Images/contnt12.jpg", "VG516.jpg"],
|
32 |
["Content_Images/contnt2.jpg", "Content_Images/styl9.jpg"],
|
33 |
["Content_Images/contnt.jpg", "Content_Images/styl22.jpg"]
|
34 |
],
|
35 |
+
article="References-\n\nExploring the structure of a real-time, arbitrary neural artistic stylization network. Golnaz Ghiasi, Honglak Lee, Manjunath Kudlur, Vincent Dumoulin."
|
|
|
36 |
)
|
37 |
|
38 |
+
demo.launch(share=True)
|