lakshya-raj commited on
Commit
fb46ba0
·
1 Parent(s): 583f98e

v3.0.2-Code fix and triage

Browse files
Files changed (4) hide show
  1. app.py +4 -4
  2. cheetah.jpg +0 -0
  3. lion.jpg +0 -0
  4. requirements.txt +0 -2
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
- import numpy as np
3
  import torch
4
  import requests
5
- from PIL import Image
6
  from torchvision import transforms
7
 
8
  model = torch.hub.load('pytorch/vision:v0.6.0', 'resnet18', pretrained=True).eval()
@@ -33,8 +33,8 @@ def predict(inp):
33
 
34
  # demo = gr.Interface(fn=sepia, inputs="image", outputs="image")
35
  demo = gr.Interface(fn=predict,
36
- inputs=gr.Image(type="pil"),
37
- outputs=gr.Label(num_top_classes=3),
38
  examples=["lion.jpg", "cheetah.jpg"])
39
  demo.launch()
40
 
 
1
  import gradio as gr
2
+ # import numpy as np
3
  import torch
4
  import requests
5
+ # from PIL import Image
6
  from torchvision import transforms
7
 
8
  model = torch.hub.load('pytorch/vision:v0.6.0', 'resnet18', pretrained=True).eval()
 
33
 
34
  # demo = gr.Interface(fn=sepia, inputs="image", outputs="image")
35
  demo = gr.Interface(fn=predict,
36
+ inputs=gr.inputs.Image(type="pil"),
37
+ outputs=gr.outputs.Label(num_top_classes=3),
38
  examples=["lion.jpg", "cheetah.jpg"])
39
  demo.launch()
40
 
cheetah.jpg ADDED
lion.jpg ADDED
requirements.txt CHANGED
@@ -1,6 +1,4 @@
1
  gradio
2
- numpy
3
  torch
4
  requests
5
- PIL
6
  torchvision
 
1
  gradio
 
2
  torch
3
  requests
 
4
  torchvision