Commit
·
71b6b7a
1
Parent(s):
7b16201
Frontmatter
Browse files- main.py +3 -0
- requirements.txt +1 -0
main.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import requests
|
|
|
4 |
from torchvision import transforms
|
5 |
|
|
|
6 |
model = torch.hub.load("pytorch/vision:v0.6.0", "resnet18", pretrained=True).eval()
|
7 |
response = requests.get("https://git.io/JJkYN")
|
8 |
labels = response.text.split("\n")
|
@@ -21,6 +23,7 @@ def run():
|
|
21 |
fn=predict,
|
22 |
inputs=gr.Image(type="pil"),
|
23 |
outputs=gr.Label(num_top_classes=3),
|
|
|
24 |
)
|
25 |
|
26 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import requests
|
4 |
+
import frontmatter
|
5 |
from torchvision import transforms
|
6 |
|
7 |
+
description = frontmatter.load("README.md").content
|
8 |
model = torch.hub.load("pytorch/vision:v0.6.0", "resnet18", pretrained=True).eval()
|
9 |
response = requests.get("https://git.io/JJkYN")
|
10 |
labels = response.text.split("\n")
|
|
|
23 |
fn=predict,
|
24 |
inputs=gr.Image(type="pil"),
|
25 |
outputs=gr.Label(num_top_classes=3),
|
26 |
+
description=description
|
27 |
)
|
28 |
|
29 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
requirements.txt
CHANGED
@@ -2,3 +2,4 @@ gradio
|
|
2 |
torch
|
3 |
torchvision
|
4 |
requests
|
|
|
|
2 |
torch
|
3 |
torchvision
|
4 |
requests
|
5 |
+
python-frontmatter
|