nostalgebraist commited on
Commit
1c987b2
·
1 Parent(s): e5509f2
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -94,12 +94,18 @@ if st.button('rweerew'):
94
  high_res = st.empty()
95
 
96
  count_low_res, count_high_res = 0, 0
97
- times_low-
 
 
98
 
99
  for s, xs in handler(text, ts1, ts2, gs1):
100
  s = Image.fromarray(s[0])
101
  xs = Image.fromarray(xs[0])
102
 
 
 
 
 
103
  is_high_res = s.size[0] == 256
104
 
105
  if is_high_res:
@@ -107,15 +113,21 @@ if st.button('rweerew'):
107
  count_high_res += 1
108
  count = count_high_res
109
  total = ts2
 
 
110
  else:
111
  target = low_res
112
  count_low_res += 1
113
  count = count_low_res
114
  total = ts1
 
 
 
 
115
 
116
  with target.container():
117
  st.image([s, xs])
118
- st.write(f'{count} / {total}')
119
 
120
 
121
  # x = st.slider('Select a value')
 
94
  high_res = st.empty()
95
 
96
  count_low_res, count_high_res = 0, 0
97
+ times_low, times_high = []
98
+
99
+ t = 0
100
 
101
  for s, xs in handler(text, ts1, ts2, gs1):
102
  s = Image.fromarray(s[0])
103
  xs = Image.fromarray(xs[0])
104
 
105
+ t2 = time.time()
106
+ delta = t2 - t
107
+ t = t2
108
+
109
  is_high_res = s.size[0] == 256
110
 
111
  if is_high_res:
 
113
  count_high_res += 1
114
  count = count_high_res
115
  total = ts2
116
+ times_high.append(delta)
117
+ times = times_high
118
  else:
119
  target = low_res
120
  count_low_res += 1
121
  count = count_low_res
122
  total = ts1
123
+ times_low.append(delta)
124
+ times = times_low
125
+
126
+ rate = sum(times)/len(times)
127
 
128
  with target.container():
129
  st.image([s, xs])
130
+ st.write(f'{count} / {total} | {rate:.2f} seconds/frame')
131
 
132
 
133
  # x = st.slider('Select a value')