StevenChen16 commited on
Commit
1a78995
·
verified ·
1 Parent(s): 2340c45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  from train import main
 
3
 
4
  # Function to calculate the aspect ratio
5
  def calculate_aspect_ratio(width, height):
@@ -32,6 +33,7 @@ def handle_image_size_selection(img_size, content_img):
32
  None)
33
 
34
  # Define the function to process images
 
35
  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):
36
  print("Start processing")
37
  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)
 
1
  import gradio as gr
2
  from train import main
3
+ import spaces
4
 
5
  # Function to calculate the aspect ratio
6
  def calculate_aspect_ratio(width, height):
 
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
  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)