Fried commited on
Commit
cacc07f
·
1 Parent(s): 1e936b2

Add demo.launch() with show_api and share options

Browse files
Files changed (4) hide show
  1. app.py +8 -4
  2. cheetah.jpg +0 -0
  3. lion.jpg +0 -0
  4. pyproject.toml +1 -0
app.py CHANGED
@@ -19,7 +19,11 @@ def predict(inp):
19
  return confidences
20
 
21
 
22
- gr.Interface(fn=predict,
23
- inputs=gr.Image(type="pil"),
24
- outputs=gr.Label(num_top_classes=3),
25
- examples=["lion.jpg", "cheetah.jpg"]).launch()
 
 
 
 
 
19
  return confidences
20
 
21
 
22
+ demo = gr.Interface(
23
+ fn=predict,
24
+ inputs=gr.Image(type="pil"),
25
+ outputs=gr.Label(num_top_classes=3),
26
+ examples=["lion.jpg", "cheetah.jpg"])
27
+
28
+ if __name__ == "__main__":
29
+ demo.launch(show_api=True, share=True)
cheetah.jpg ADDED
lion.jpg ADDED
pyproject.toml CHANGED
@@ -12,6 +12,7 @@ torch = "^2.1.2"
12
  requests = "^2.31.0"
13
  pillow = "^10.1.0"
14
  torchvision = "^0.16.2"
 
15
 
16
 
17
  [build-system]
 
12
  requests = "^2.31.0"
13
  pillow = "^10.1.0"
14
  torchvision = "^0.16.2"
15
+ matplotlib = "^3.8.2"
16
 
17
 
18
  [build-system]