Spaces:
Sleeping
Sleeping
Steven Chen
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from train import main
|
| 3 |
import spaces
|
| 4 |
-
|
| 5 |
|
| 6 |
# Function to calculate the aspect ratio
|
| 7 |
def calculate_aspect_ratio(width, height):
|
|
@@ -37,6 +37,7 @@ def handle_image_size_selection(img_size, content_img):
|
|
| 37 |
@spaces.GPU
|
| 38 |
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):
|
| 39 |
print("Start processing")
|
|
|
|
| 40 |
print(tf.config.list_physical_devices('GPU'))
|
| 41 |
with tf.device("/physical_device:GPU:0"):
|
| 42 |
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 |
|
| 6 |
# Function to calculate the aspect ratio
|
| 7 |
def calculate_aspect_ratio(width, height):
|
|
|
|
| 37 |
@spaces.GPU
|
| 38 |
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):
|
| 39 |
print("Start processing")
|
| 40 |
+
import tensorflow as tf
|
| 41 |
print(tf.config.list_physical_devices('GPU'))
|
| 42 |
with tf.device("/physical_device:GPU:0"):
|
| 43 |
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)
|