Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,12 +33,14 @@ def handle_image_size_selection(img_size, content_img):
|
|
33 |
None)
|
34 |
|
35 |
# Define the function to process images
|
|
|
36 |
def process_images(content_img, style_img, epochs, steps_per_epoch, learning_rate, content_loss_factor, style_loss_factor, img_size, img_width, img_height):
|
37 |
print("Start processing")
|
38 |
-
|
|
|
39 |
return output_img
|
40 |
|
41 |
-
@spaces.GPU
|
42 |
def create_app():
|
43 |
with gr.Blocks() as demo:
|
44 |
aspect_ratio = gr.State(None)
|
|
|
33 |
None)
|
34 |
|
35 |
# Define the function to process images
|
36 |
+
@spaces.GPU
|
37 |
def process_images(content_img, style_img, epochs, steps_per_epoch, learning_rate, content_loss_factor, style_loss_factor, img_size, img_width, img_height):
|
38 |
print("Start processing")
|
39 |
+
with device("/cuda:0"):
|
40 |
+
output_img = main(content_img, style_img, epochs, steps_per_epoch, learning_rate, content_loss_factor, style_loss_factor, img_size, img_width, img_height)
|
41 |
return output_img
|
42 |
|
43 |
+
# @spaces.GPU
|
44 |
def create_app():
|
45 |
with gr.Blocks() as demo:
|
46 |
aspect_ratio = gr.State(None)
|