Spaces:
Runtime error
Runtime error
running it locally is a good first step
Browse files- README.md +9 -3
- app.py +9 -10
- hotdog.jpg +0 -0
- model.pkl → hotdog.pkl +2 -2
- poetry.lock +0 -0
- pyproject.toml +17 -0
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
-
title: Hotdog
|
3 |
-
emoji:
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
@@ -10,4 +10,10 @@ pinned: false
|
|
10 |
license: apache-2.0
|
11 |
---
|
12 |
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Hotdog or Not
|
3 |
+
emoji: 🌭
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
|
|
10 |
license: apache-2.0
|
11 |
---
|
12 |
|
13 |
+
Check out the configuration reference at <https://huggingface.co/docs/hub/spaces-config-reference>
|
14 |
+
|
15 |
+
## Run locally
|
16 |
+
|
17 |
+
```
|
18 |
+
poetry run ./app.py
|
19 |
+
```
|
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
-
learn = load_learner("
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
|
@@ -14,20 +16,17 @@ def predict(img):
|
|
14 |
|
15 |
|
16 |
title = "Hotdog or Not?"
|
17 |
-
description = "
|
18 |
-
|
19 |
-
examples = ["siamese.jpg"]
|
20 |
interpretation = "default"
|
21 |
enable_queue = True
|
22 |
|
23 |
gr.Interface(
|
24 |
fn=predict,
|
25 |
-
inputs=gr.
|
26 |
-
outputs=gr.
|
27 |
title=title,
|
28 |
description=description,
|
29 |
-
|
30 |
-
examples=examples,
|
31 |
interpretation=interpretation,
|
32 |
-
|
33 |
-
).launch()
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
|
3 |
import gradio as gr
|
4 |
from fastai.vision.all import *
|
5 |
import skimage
|
6 |
|
7 |
+
learn = load_learner("hotdog.pkl")
|
8 |
|
9 |
labels = learn.dls.vocab
|
10 |
|
|
|
16 |
|
17 |
|
18 |
title = "Hotdog or Not?"
|
19 |
+
description = "Upload a picture of a hotdog or hamburger and be amazed!"
|
20 |
+
examples = ["hotdog.jpg"]
|
|
|
21 |
interpretation = "default"
|
22 |
enable_queue = True
|
23 |
|
24 |
gr.Interface(
|
25 |
fn=predict,
|
26 |
+
inputs=gr.components.Image(shape=(512, 512)),
|
27 |
+
outputs=gr.components.Label(num_top_classes=3),
|
28 |
title=title,
|
29 |
description=description,
|
30 |
+
# examples=examples,
|
|
|
31 |
interpretation=interpretation,
|
32 |
+
).launch(enable_queue=enable_queue)
|
|
hotdog.jpg
ADDED
model.pkl → hotdog.pkl
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7fdf86706b83a7124b708e9c09c7743c7942a655503242985b362bc43f87cf6d
|
3 |
+
size 46952996
|
poetry.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.poetry]
|
2 |
+
name = "hotdog-or-not"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = ""
|
5 |
+
authors = ["Myers Carpenter <[email protected]>"]
|
6 |
+
readme = "README.md"
|
7 |
+
packages = [{include = "hotdog_or_not"}]
|
8 |
+
|
9 |
+
[tool.poetry.dependencies]
|
10 |
+
python = "^3.8"
|
11 |
+
fastai = "^2.7.12"
|
12 |
+
scikit-image = "^0.20.0"
|
13 |
+
gradio = "^3.28.1"
|
14 |
+
|
15 |
+
[build-system]
|
16 |
+
requires = ["poetry-core"]
|
17 |
+
build-backend = "poetry.core.masonry.api"
|