Spaces:
Runtime error
Runtime error
Commit
·
b5022cb
1
Parent(s):
7710c78
add more examples
Browse files
app.py
CHANGED
@@ -30,9 +30,21 @@ style_image = st.file_uploader("Upload a style image")
|
|
30 |
|
31 |
# default images
|
32 |
st.write("Or you can choose from the following examples")
|
33 |
-
col1, col2, col3 = st.columns(
|
34 |
|
35 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
content_image = "examples/joshua_tree.jpeg"
|
37 |
style_image = "examples/starry_night.jpeg"
|
38 |
|
@@ -45,13 +57,13 @@ if style_image and content_image is not None:
|
|
45 |
# It is recommended that the style image is about 256 pixels (this size was used when training the style transfer network).
|
46 |
style_image = Image.open(style_image).resize((256, 256))
|
47 |
|
48 |
-
output_image=perform_style_transfer(content_image, style_image)
|
49 |
-
|
50 |
col1.header("Content Image")
|
51 |
col1.image(content_image, use_column_width=True)
|
52 |
col2.header("Style Image")
|
53 |
col2.image(style_image, use_column_width=True)
|
54 |
|
|
|
|
|
55 |
st.header("Output: Style transfer Image")
|
56 |
st.image(output_image, use_column_width=True)
|
57 |
|
|
|
30 |
|
31 |
# default images
|
32 |
st.write("Or you can choose from the following examples")
|
33 |
+
col1, col2, col3,col4 = st.columns(4)
|
34 |
|
35 |
+
if col1.button("Couple on bench"):
|
36 |
+
content_image = "examples/couple_on_bench.jpeg"
|
37 |
+
style_image = "examples/starry_night.jpeg"
|
38 |
+
|
39 |
+
if col2.button("Couple Walking"):
|
40 |
+
content_image = "examples/couple_walking.jpeg"
|
41 |
+
style_image = "examples/couple_watercolor.jpeg"
|
42 |
+
|
43 |
+
if col3.button("Golden Gate Bridge"):
|
44 |
+
content_image = "examples/golden_gate_bridge.jpeg"
|
45 |
+
style_image = "examples/the_great_wave.jpeg"
|
46 |
+
|
47 |
+
if col4.button("Joshua Tree"):
|
48 |
content_image = "examples/joshua_tree.jpeg"
|
49 |
style_image = "examples/starry_night.jpeg"
|
50 |
|
|
|
57 |
# It is recommended that the style image is about 256 pixels (this size was used when training the style transfer network).
|
58 |
style_image = Image.open(style_image).resize((256, 256))
|
59 |
|
|
|
|
|
60 |
col1.header("Content Image")
|
61 |
col1.image(content_image, use_column_width=True)
|
62 |
col2.header("Style Image")
|
63 |
col2.image(style_image, use_column_width=True)
|
64 |
|
65 |
+
output_image=perform_style_transfer(content_image, style_image)
|
66 |
+
|
67 |
st.header("Output: Style transfer Image")
|
68 |
st.image(output_image, use_column_width=True)
|
69 |
|