akhaliq HF staff commited on
Commit
962694d
1 Parent(s): 6b0f689

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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():