Nigus commited on
Commit
37df3c6
1 Parent(s): a793711

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -4,15 +4,8 @@ from torchvision import transforms
4
  import gradio as gr
5
  import os
6
 
7
- torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
8
-
9
- # To export
10
- model = torch.hub.load('pytorch/vision:v0.10.0', 'shufflenet_v2_x1_0', pretrained=True).eval()
11
- traced_graph = torch.jit.trace(model, torch.randn(1, 3, H, W))
12
- traced_graph.save('shufflenet.pth')
13
-
14
- # To load
15
- model = torch.jit.load('shufflenet.pth').eval().to(device)
16
 
17
 
18
  os.system("wget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt")
@@ -55,6 +48,6 @@ description = " Thesis Title: The Development of a
55
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1807.11164'>Shufflenet_v2 By Bekalu Nigus Dawit</a></p>"
56
 
57
  examples = [
58
- ['dog.jpg'],['pizza.jpeg'],['mushroom.jpeg'],['download.jpeg'],['ear.jpeg']
59
  ]
60
  gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=examples, analytics_enabled=False).launch()
 
4
  import gradio as gr
5
  import os
6
 
7
+ model = torch.hub.load('pytorch/vision:v0.9.0', 'shufflenet_v2_x1_0', pretrained=True)
8
+ model.eval()
 
 
 
 
 
 
 
9
 
10
 
11
  os.system("wget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt")
 
48
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1807.11164'>Shufflenet_v2 By Bekalu Nigus Dawit</a></p>"
49
 
50
  examples = [
51
+ ['pizza.jpeg'],['mushroom.jpeg'],['download.jpeg'],['ear.jpeg']
52
  ]
53
  gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=examples, analytics_enabled=False).launch()