Spaces:
Runtime error
Runtime error
Nifdi Guliyev
commited on
Commit
·
2913642
1
Parent(s):
48c9f11
message
Browse files- .ipynb_checkpoints/{Untitled-checkpoint.ipynb → app-checkpoint.ipynb} +0 -0
- .ipynb_checkpoints/train-checkpoint.ipynb +0 -0
- app.ipynb +0 -0
- app.py +15 -4
- basset.jpg +0 -0
- breed_model.pkl +3 -0
- requirements.txt +0 -0
- train.ipynb +0 -0
.ipynb_checkpoints/{Untitled-checkpoint.ipynb → app-checkpoint.ipynb}
RENAMED
File without changes
|
.ipynb_checkpoints/train-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -1,7 +1,18 @@
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
+
import timm
|
4 |
|
5 |
+
learn = load_learner('breed_model.pkl')
|
|
|
6 |
|
7 |
+
categories = learn.dls.vocab
|
8 |
+
|
9 |
+
def classify_image(img):
|
10 |
+
pred, idx, probs = learn.predict(img)
|
11 |
+
return dict(zip(categories, map(float, probs)))
|
12 |
+
|
13 |
+
image = gr.inputs.Image((192, 192))
|
14 |
+
label = gr.outputs.Label()
|
15 |
+
examples = ['basset.jpg']
|
16 |
+
|
17 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
18 |
+
intf.launch(inline=False)
|
basset.jpg
ADDED
![]() |
breed_model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89e58732055f4203aba0571bed774cbf551adc3c82d01d48c79393fde713cb25
|
3 |
+
size 114806679
|
requirements.txt
ADDED
File without changes
|
train.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|