change default dog image
Browse files
app.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -1,27 +1,9 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: .
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
#
|
6 |
from fastai.vision.all import *
|
7 |
import gradio as gr
|
8 |
import timm
|
9 |
-
|
10 |
-
# Cell
|
11 |
-
learn = load_learner('model.pkl')
|
12 |
-
|
13 |
-
# Cell
|
14 |
-
categories = learn.dls.vocab
|
15 |
-
|
16 |
-
def classify_image(img):
|
17 |
-
pred,idx,probs = learn.predict(img)
|
18 |
-
return dict(zip(categories, map(float,probs)))
|
19 |
-
|
20 |
-
# Cell
|
21 |
-
image = gr.inputs.Image(shape=(192, 192))
|
22 |
-
label = gr.outputs.Label()
|
23 |
-
examples = ['basset.jpg']
|
24 |
-
|
25 |
-
# Cell
|
26 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
27 |
-
intf.launch()
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
|
2 |
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = []
|
5 |
|
6 |
+
# %% app.ipynb 3
|
7 |
from fastai.vision.all import *
|
8 |
import gradio as gr
|
9 |
import timm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dog.jpeg
ADDED
![]() |