Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -42,6 +42,7 @@ for style_name, style_img_path in style_options.items():
|
|
42 |
|
43 |
@spaces.GPU(duration=10)
|
44 |
def run(content_image, style_name, style_strength, output_quality, progress=gr.Progress(track_tqdm=True)):
|
|
|
45 |
img_size = 1024 if output_quality else 512
|
46 |
content_img, original_size = preprocess_img(content_image, img_size)
|
47 |
content_img = content_img.to(device)
|
@@ -66,7 +67,7 @@ def run(content_image, style_name, style_strength, output_quality, progress=gr.P
|
|
66 |
et = time.time()
|
67 |
print('TIME TAKEN:', et-st)
|
68 |
|
69 |
-
|
70 |
|
71 |
|
72 |
def set_slider(value):
|
|
|
42 |
|
43 |
@spaces.GPU(duration=10)
|
44 |
def run(content_image, style_name, style_strength, output_quality, progress=gr.Progress(track_tqdm=True)):
|
45 |
+
yield None
|
46 |
img_size = 1024 if output_quality else 512
|
47 |
content_img, original_size = preprocess_img(content_image, img_size)
|
48 |
content_img = content_img.to(device)
|
|
|
67 |
et = time.time()
|
68 |
print('TIME TAKEN:', et-st)
|
69 |
|
70 |
+
yield postprocess_img(generated_img, original_size)
|
71 |
|
72 |
|
73 |
def set_slider(value):
|