Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
c8a9d06
1
Parent(s):
9988281
Update app.py
Browse files
app.py
CHANGED
|
@@ -145,8 +145,7 @@ def param2img_serial(
|
|
| 145 |
device=this_canvas.device)
|
| 146 |
selected_alphas = torch.zeros(selected_param.shape[0], 3, patch_size_y, patch_size_x, device=this_canvas.device)
|
| 147 |
if selected_param[selected_decision, :].shape[0] > 0:
|
| 148 |
-
selected_foregrounds[selected_decision, :, :, :], selected_alphas[selected_decision, :, :, :] =
|
| 149 |
-
param2stroke(selected_param[selected_decision, :], patch_size_y, patch_size_x, meta_brushes)
|
| 150 |
selected_foregrounds = selected_foregrounds.view(
|
| 151 |
b, selected_h, selected_w, 3, patch_size_y, patch_size_x).contiguous()
|
| 152 |
selected_alphas = selected_alphas.view(b, selected_h, selected_w, 3, patch_size_y, patch_size_x).contiguous()
|
|
@@ -516,8 +515,8 @@ def gradio_inference(image):
|
|
| 516 |
model_path='model.pth',
|
| 517 |
output_dir='output/',
|
| 518 |
need_animation=True, # whether need intermediate results for animation.
|
| 519 |
-
resize_h=
|
| 520 |
-
resize_w=
|
| 521 |
serial=True) # if need animation, serial must be True.
|
| 522 |
|
| 523 |
title = "Anime2Sketch"
|
|
|
|
| 145 |
device=this_canvas.device)
|
| 146 |
selected_alphas = torch.zeros(selected_param.shape[0], 3, patch_size_y, patch_size_x, device=this_canvas.device)
|
| 147 |
if selected_param[selected_decision, :].shape[0] > 0:
|
| 148 |
+
selected_foregrounds[selected_decision, :, :, :], selected_alphas[selected_decision, :, :, :] = \\n param2stroke(selected_param[selected_decision, :], patch_size_y, patch_size_x, meta_brushes)
|
|
|
|
| 149 |
selected_foregrounds = selected_foregrounds.view(
|
| 150 |
b, selected_h, selected_w, 3, patch_size_y, patch_size_x).contiguous()
|
| 151 |
selected_alphas = selected_alphas.view(b, selected_h, selected_w, 3, patch_size_y, patch_size_x).contiguous()
|
|
|
|
| 515 |
model_path='model.pth',
|
| 516 |
output_dir='output/',
|
| 517 |
need_animation=True, # whether need intermediate results for animation.
|
| 518 |
+
resize_h=400, # resize original input to this size. None means do not resize.
|
| 519 |
+
resize_w=400, # resize original input to this size. None means do not resize.
|
| 520 |
serial=True) # if need animation, serial must be True.
|
| 521 |
|
| 522 |
title = "Anime2Sketch"
|