Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import torch
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 5 |
|
|
@@ -12,7 +13,7 @@ def inference(img):
|
|
| 12 |
|
| 13 |
img_transforms = transforms.Compose(
|
| 14 |
[transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor()]
|
| 15 |
-
|
| 16 |
|
| 17 |
img = img_transforms(img)
|
| 18 |
with torch.no_grad():
|
|
|
|
| 1 |
import torch
|
| 2 |
import gradio as gr
|
| 3 |
+
import torchvision.transforms as transforms
|
| 4 |
|
| 5 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 6 |
|
|
|
|
| 13 |
|
| 14 |
img_transforms = transforms.Compose(
|
| 15 |
[transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor()]
|
| 16 |
+
)
|
| 17 |
|
| 18 |
img = img_transforms(img)
|
| 19 |
with torch.no_grad():
|