Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -9,14 +9,14 @@ import torch.optim as optim
|
|
9 |
import gradio as gr
|
10 |
|
11 |
from utils import preprocess_img, preprocess_img_from_path, postprocess_img
|
12 |
-
from
|
13 |
|
14 |
if torch.cuda.is_available(): device = 'cuda'
|
15 |
elif torch.backends.mps.is_available(): device = 'mps'
|
16 |
else: device = 'cpu'
|
17 |
print('DEVICE:', device)
|
18 |
|
19 |
-
model =
|
20 |
for param in model.parameters():
|
21 |
param.requires_grad = False
|
22 |
|
|
|
9 |
import gradio as gr
|
10 |
|
11 |
from utils import preprocess_img, preprocess_img_from_path, postprocess_img
|
12 |
+
from vgg16 import VGG_16
|
13 |
|
14 |
if torch.cuda.is_available(): device = 'cuda'
|
15 |
elif torch.backends.mps.is_available(): device = 'mps'
|
16 |
else: device = 'cpu'
|
17 |
print('DEVICE:', device)
|
18 |
|
19 |
+
model = VGG_16().to(device)
|
20 |
for param in model.parameters():
|
21 |
param.requires_grad = False
|
22 |
|