Spaces:
Runtime error
Runtime error
therealcyberlord
commited on
Commit
·
6e80436
1
Parent(s):
33921d3
column layout
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ checkpoint_path = "Checkpoints/150epochs.chkpt"
|
|
17 |
st.title("Generating Abstract Art")
|
18 |
|
19 |
st.sidebar.subheader("Configurations")
|
20 |
-
seed = st.sidebar.slider('Seed', -
|
21 |
|
22 |
num_images = st.sidebar.slider('Number of Images', 1, 10, 1)
|
23 |
|
@@ -27,7 +27,7 @@ use_srgan = st.sidebar.selectbox(
|
|
27 |
)
|
28 |
|
29 |
generate = st.sidebar.button("Generate")
|
30 |
-
|
31 |
|
32 |
# caching the expensive model loading
|
33 |
|
@@ -65,16 +65,19 @@ if generate:
|
|
65 |
enhanced_fakes = esrgan_generator(fakes).detach().cpu()
|
66 |
color_match = color_histogram_mapping(enhanced_fakes, fakes.cpu())
|
67 |
|
|
|
68 |
for i in range(len(color_match)):
|
69 |
# denormalize and permute to correct color channel
|
70 |
-
|
71 |
|
72 |
|
73 |
# default setting -> vanilla dcgan generation
|
74 |
if use_srgan == "No":
|
75 |
fakes = fakes.cpu()
|
|
|
|
|
76 |
for i in range(len(fakes)):
|
77 |
-
|
78 |
|
79 |
|
80 |
|
|
|
17 |
st.title("Generating Abstract Art")
|
18 |
|
19 |
st.sidebar.subheader("Configurations")
|
20 |
+
seed = st.sidebar.slider('Seed', -100000, 100000, 0)
|
21 |
|
22 |
num_images = st.sidebar.slider('Number of Images', 1, 10, 1)
|
23 |
|
|
|
27 |
)
|
28 |
|
29 |
generate = st.sidebar.button("Generate")
|
30 |
+
st.write("Get started using the left side bar :sunglasses:")
|
31 |
|
32 |
# caching the expensive model loading
|
33 |
|
|
|
65 |
enhanced_fakes = esrgan_generator(fakes).detach().cpu()
|
66 |
color_match = color_histogram_mapping(enhanced_fakes, fakes.cpu())
|
67 |
|
68 |
+
cols = st.columns(num_images)
|
69 |
for i in range(len(color_match)):
|
70 |
# denormalize and permute to correct color channel
|
71 |
+
cols[i].image(denormalize_images(color_match[i]).permute(1, 2, 0).numpy(), use_column_width=True)
|
72 |
|
73 |
|
74 |
# default setting -> vanilla dcgan generation
|
75 |
if use_srgan == "No":
|
76 |
fakes = fakes.cpu()
|
77 |
+
|
78 |
+
cols = st.columns(num_images)
|
79 |
for i in range(len(fakes)):
|
80 |
+
cols[i].image(denormalize_images(fakes[i]).permute(1, 2, 0).numpy(), use_column_width=True)
|
81 |
|
82 |
|
83 |
|