Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,11 +142,11 @@ def get_imgs(base_image_path, style_reference_image_path):
|
|
| 142 |
|
| 143 |
# Dimensions of the generated picture.
|
| 144 |
width, height = base_image.size
|
| 145 |
-
img_nrows = 400
|
| 146 |
-
img_ncols = int(width * img_nrows / height)
|
| 147 |
global img_nrows
|
| 148 |
global img_ncols
|
| 149 |
-
|
|
|
|
|
|
|
| 150 |
iterations = 400
|
| 151 |
for i in range(1, iterations + 1):
|
| 152 |
loss, grads = compute_loss_and_grads(combination_image, base_image, style_reference_image)
|
|
@@ -154,7 +154,6 @@ def get_imgs(base_image_path, style_reference_image_path):
|
|
| 154 |
if i % 100 == 0:
|
| 155 |
print("Iteration %d: loss=%.2f" % (i, loss))
|
| 156 |
img = deprocess_image(combination_image.numpy())
|
| 157 |
-
|
| 158 |
return img
|
| 159 |
|
| 160 |
|
|
|
|
| 142 |
|
| 143 |
# Dimensions of the generated picture.
|
| 144 |
width, height = base_image.size
|
|
|
|
|
|
|
| 145 |
global img_nrows
|
| 146 |
global img_ncols
|
| 147 |
+
img_nrows = 400
|
| 148 |
+
img_ncols = int(width * img_nrows / height)
|
| 149 |
+
|
| 150 |
iterations = 400
|
| 151 |
for i in range(1, iterations + 1):
|
| 152 |
loss, grads = compute_loss_and_grads(combination_image, base_image, style_reference_image)
|
|
|
|
| 154 |
if i % 100 == 0:
|
| 155 |
print("Iteration %d: loss=%.2f" % (i, loss))
|
| 156 |
img = deprocess_image(combination_image.numpy())
|
|
|
|
| 157 |
return img
|
| 158 |
|
| 159 |
|