Spaces:
Runtime error
Runtime error
Commit
·
4ef7cbc
1
Parent(s):
ab4b236
log
Browse files
app.py
CHANGED
@@ -79,18 +79,33 @@ def handler(text, ts1, ts2, gs1):
|
|
79 |
|
80 |
text = st.text_area('asdf')
|
81 |
|
|
|
|
|
82 |
if st.button('rweerew'):
|
83 |
low_res = st.empty()
|
84 |
high_res = st.empty()
|
85 |
|
86 |
-
|
|
|
|
|
87 |
print((type(s), s.shape))
|
88 |
print((type(xs), s.shape))
|
89 |
s = Image.fromarray(s[0])
|
90 |
xs = Image.fromarray(xs[0])
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
with target.container():
|
93 |
st.image([s, xs])
|
|
|
|
|
94 |
|
95 |
# x = st.slider('Select a value')
|
96 |
# st.write(x, 'squared is', x * x)
|
|
|
79 |
|
80 |
text = st.text_area('asdf')
|
81 |
|
82 |
+
ts1, ts2, gs1 = 20, 20, 0
|
83 |
+
|
84 |
if st.button('rweerew'):
|
85 |
low_res = st.empty()
|
86 |
high_res = st.empty()
|
87 |
|
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 |
+
count += 1
|
105 |
with target.container():
|
106 |
st.image([s, xs])
|
107 |
+
st.write(f'{count} / {total}')
|
108 |
+
|
109 |
|
110 |
# x = st.slider('Select a value')
|
111 |
# st.write(x, 'squared is', x * x)
|