englert commited on
Commit
fc405ab
1 Parent(s): 95a33ce

fix missing img

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -7,6 +7,8 @@ model = torch.hub.load('pytorch/vision:v0.6.0', 'resnet18', pretrained=True).eva
7
  response = requests.get("https://git.io/JJkYN")
8
  labels = response.text.split("\n")
9
 
 
 
10
  def predict(inp):
11
  inp = transforms.ToTensor()(inp).unsqueeze(0)
12
  with torch.no_grad():
@@ -17,7 +19,7 @@ def predict(inp):
17
  demo = gr.Interface(fn=predict,
18
  inputs=gr.inputs.Image(type="pil"),
19
  outputs=gr.outputs.Label(num_top_classes=3),
20
- examples=[["cheetah.jpg"]],
21
  )
22
 
23
  demo.launch()
 
7
  response = requests.get("https://git.io/JJkYN")
8
  labels = response.text.split("\n")
9
 
10
+ torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
11
+
12
  def predict(inp):
13
  inp = transforms.ToTensor()(inp).unsqueeze(0)
14
  with torch.no_grad():
 
19
  demo = gr.Interface(fn=predict,
20
  inputs=gr.inputs.Image(type="pil"),
21
  outputs=gr.outputs.Label(num_top_classes=3),
22
+ examples=[["dog.jpg"]],
23
  )
24
 
25
  demo.launch()