Herrius
commited on
Commit
•
f8308fd
1
Parent(s):
dea42f1
update model
Browse files- app.py +16 -0
- model.pkl +3 -0
- pimenton.jpg +0 -0
- requiriments.txt +3 -0
- rocoto.jpg +0 -0
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
# Cell
|
5 |
+
categories = ('rocoto','pimenton')
|
6 |
+
def classify_image(img):
|
7 |
+
pred,idx,probs = learn.predict(img)
|
8 |
+
return dict(zip(categories, map(float,probs)))
|
9 |
+
|
10 |
+
# Cell
|
11 |
+
image = gr.inputs.Image(shape=(192, 192))
|
12 |
+
label = gr.outputs.Label()
|
13 |
+
examples = ['rocoto.jpg','pimenton.jpg']
|
14 |
+
|
15 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
16 |
+
intf.launch(inline=False)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b8655b00a4aca5238507b70c0cc43e6d103b31b0366d0c2ca84ab7fd35df11d3
|
3 |
+
size 87461995
|
pimenton.jpg
ADDED
requiriments.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|
3 |
+
fastai
|
rocoto.jpg
ADDED