Spaces:
Runtime error
Runtime error
Commit
·
4a15936
1
Parent(s):
4ef7cbc
various
Browse files
app.py
CHANGED
@@ -79,7 +79,10 @@ def handler(text, ts1, ts2, gs1):
|
|
79 |
|
80 |
text = st.text_area('asdf')
|
81 |
|
82 |
-
ts1
|
|
|
|
|
|
|
83 |
|
84 |
if st.button('rweerew'):
|
85 |
low_res = st.empty()
|
@@ -88,20 +91,22 @@ if st.button('rweerew'):
|
|
88 |
count_low_res, count_high_res = 0, 0
|
89 |
|
90 |
for s, xs in handler(text, ts1, ts2, gs1):
|
91 |
-
print((type(s), s.shape))
|
92 |
-
print((type(xs), s.shape))
|
93 |
s = Image.fromarray(s[0])
|
94 |
xs = Image.fromarray(xs[0])
|
|
|
95 |
is_high_res = s.size[0] == 256
|
|
|
96 |
if is_high_res:
|
97 |
target = high_res
|
|
|
98 |
count = count_high_res
|
99 |
total = ts2
|
100 |
else:
|
101 |
target = low_res
|
|
|
102 |
count = count_low_res
|
103 |
total = ts1
|
104 |
-
|
105 |
with target.container():
|
106 |
st.image([s, xs])
|
107 |
st.write(f'{count} / {total}')
|
|
|
79 |
|
80 |
text = st.text_area('asdf')
|
81 |
|
82 |
+
ts1 = st.slider('steps1', min_value=5, max_value=500, value=10)
|
83 |
+
ts2 = st.slider('steps1', min_value=5, max_value=500, value=10)
|
84 |
+
gs = st.slider('gs', min_value=0., max_value=4., value=0.)
|
85 |
+
# ts1, ts2, gs1 = 20, 20, 0
|
86 |
|
87 |
if st.button('rweerew'):
|
88 |
low_res = st.empty()
|
|
|
91 |
count_low_res, count_high_res = 0, 0
|
92 |
|
93 |
for s, xs in handler(text, ts1, ts2, gs1):
|
|
|
|
|
94 |
s = Image.fromarray(s[0])
|
95 |
xs = Image.fromarray(xs[0])
|
96 |
+
|
97 |
is_high_res = s.size[0] == 256
|
98 |
+
|
99 |
if is_high_res:
|
100 |
target = high_res
|
101 |
+
count_high_res += 1
|
102 |
count = count_high_res
|
103 |
total = ts2
|
104 |
else:
|
105 |
target = low_res
|
106 |
+
count_low_res += 1
|
107 |
count = count_low_res
|
108 |
total = ts1
|
109 |
+
|
110 |
with target.container():
|
111 |
st.image([s, xs])
|
112 |
st.write(f'{count} / {total}')
|