Spaces:
Runtime error
Runtime error
Jasmeet Singh commited on
importing spaces
Browse files- styleTransfer.py +2 -0
styleTransfer.py
CHANGED
|
@@ -6,10 +6,12 @@ from PIL import Image #for importing images
|
|
| 6 |
import torchvision.models as models #to load vgg 19 model
|
| 7 |
import torchvision.transforms as transforms
|
| 8 |
from tqdm import tqdm
|
|
|
|
| 9 |
|
| 10 |
from dataTransform import load_image
|
| 11 |
from vggModel import VGGNet
|
| 12 |
|
|
|
|
| 13 |
def style_transfer(content_img, style_img, total_steps, alpha=1e5, beta=1e10, learning_rate=0.001):
|
| 14 |
# Preprocess the input images
|
| 15 |
|
|
|
|
| 6 |
import torchvision.models as models #to load vgg 19 model
|
| 7 |
import torchvision.transforms as transforms
|
| 8 |
from tqdm import tqdm
|
| 9 |
+
import spaces
|
| 10 |
|
| 11 |
from dataTransform import load_image
|
| 12 |
from vggModel import VGGNet
|
| 13 |
|
| 14 |
+
@spaces.GPU
|
| 15 |
def style_transfer(content_img, style_img, total_steps, alpha=1e5, beta=1e10, learning_rate=0.001):
|
| 16 |
# Preprocess the input images
|
| 17 |
|