Spaces:
Runtime error
Runtime error
Commit
·
88ca5ae
1
Parent(s):
ab130ea
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,8 +70,18 @@ def double_res(input_image):
|
|
| 70 |
128-64:i*128+64, j*128-64:j*128+64]/255
|
| 71 |
to_predict.append(lower_left_slice)
|
| 72 |
|
| 73 |
-
# predicting all images at once
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
counter = 0
|
| 76 |
for i in range(height):
|
| 77 |
for j in range(width):
|
|
|
|
| 70 |
128-64:i*128+64, j*128-64:j*128+64]/255
|
| 71 |
to_predict.append(lower_left_slice)
|
| 72 |
|
| 73 |
+
# predicting all images at once
|
| 74 |
+
completed = False
|
| 75 |
+
n = 8
|
| 76 |
+
while not completed:
|
| 77 |
+
try:
|
| 78 |
+
predicted = model.predict(np.array(to_predict),batch_size = n)
|
| 79 |
+
completed = True
|
| 80 |
+
print("completed with "+ str(n))
|
| 81 |
+
except:
|
| 82 |
+
n += -1
|
| 83 |
+
if n <= 0:
|
| 84 |
+
n = 1
|
| 85 |
counter = 0
|
| 86 |
for i in range(height):
|
| 87 |
for j in range(width):
|