Yaron Koresh commited on
Commit
91229ed
·
verified ·
1 Parent(s): 86e141f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -191,14 +191,14 @@ def run1(p1,p2,*result):
191
  print("images: "+str(ln))
192
  rng = list(range(ln))
193
 
194
- arr1 = [p for _ in rng]
195
- pool1 = Pool(ln)
196
- out1 = list(pool1.imap(infer1,arr1))
197
- pool1.close()
198
- pool1.join()
199
- pool1.clear()
200
 
201
- return out1
202
 
203
  def run2(p1,p2,*result):
204
 
@@ -209,14 +209,14 @@ def run2(p1,p2,*result):
209
  print("images: "+str(ln))
210
  rng = list(range(ln))
211
 
212
- arr2 = [{"a":p1_en,"b":p2_en,"c":out1[_]} for _ in rng]
213
- pool2 = Pool(ln)
214
- out2 = list(pool2.imap(infer2,arr2))
215
- pool2.close()
216
- pool2.join()
217
- pool2.clear()
218
 
219
- return out2
220
 
221
  def main():
222
 
 
191
  print("images: "+str(ln))
192
  rng = list(range(ln))
193
 
194
+ arr = [p for _ in rng]
195
+ pool = Pool(ln)
196
+ out = list(pool1.imap(infer1,arr))
197
+ pool.close()
198
+ pool.join()
199
+ pool.clear()
200
 
201
+ return out
202
 
203
  def run2(p1,p2,*result):
204
 
 
209
  print("images: "+str(ln))
210
  rng = list(range(ln))
211
 
212
+ arr = [{"a":p1_en,"b":p2_en,"c":result[_]} for _ in rng]
213
+ pool = Pool(ln)
214
+ out = list(pool.imap(infer2,arr))
215
+ pool.close()
216
+ pool.join()
217
+ pool.clear()
218
 
219
+ return out
220
 
221
  def main():
222