Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -191,14 +191,14 @@ def run1(p1,p2,*result):
|
|
| 191 |
print("images: "+str(ln))
|
| 192 |
rng = list(range(ln))
|
| 193 |
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
|
| 201 |
-
return
|
| 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 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
|
| 219 |
-
return
|
| 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 |
|