Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- app.py +3 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
from PIL import Image
|
|
|
|
|
2 |
import torch
|
3 |
import torch.nn as nn
|
4 |
import torch.optim as optim
|
5 |
import torchvision.transforms as transforms
|
6 |
import torchvision.models as models
|
7 |
-
import torchvision.utils as utils
|
8 |
import gradio as gr
|
9 |
|
10 |
device = 'cpu'
|
@@ -73,6 +74,7 @@ def save_img(img, original_size):
|
|
73 |
return img
|
74 |
|
75 |
|
|
|
76 |
def transfer_style(content_image):
|
77 |
style_img_filename = 'StarryNight.jpg'
|
78 |
img_size = 512
|
|
|
1 |
from PIL import Image
|
2 |
+
|
3 |
+
import spaces
|
4 |
import torch
|
5 |
import torch.nn as nn
|
6 |
import torch.optim as optim
|
7 |
import torchvision.transforms as transforms
|
8 |
import torchvision.models as models
|
|
|
9 |
import gradio as gr
|
10 |
|
11 |
device = 'cpu'
|
|
|
74 |
return img
|
75 |
|
76 |
|
77 |
+
@spaces.GPU
|
78 |
def transfer_style(content_image):
|
79 |
style_img_filename = 'StarryNight.jpg'
|
80 |
img_size = 512
|
requirements.txt
CHANGED
@@ -2,4 +2,5 @@
|
|
2 |
torch
|
3 |
torchvision
|
4 |
pillow
|
5 |
-
gradio
|
|
|
|
2 |
torch
|
3 |
torchvision
|
4 |
pillow
|
5 |
+
gradio
|
6 |
+
spaces
|