Add demo.launch() with show_api and share options
Browse files- app.py +8 -4
- cheetah.jpg +0 -0
- lion.jpg +0 -0
- pyproject.toml +1 -0
app.py
CHANGED
@@ -19,7 +19,11 @@ def predict(inp):
|
|
19 |
return confidences
|
20 |
|
21 |
|
22 |
-
gr.Interface(
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
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]
|