Ayaz Akkaş
commited on
Commit
·
46efbc5
1
Parent(s):
a8780bf
Add model
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def greet(name):
|
| 4 |
-
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import imp
|
| 2 |
+
from fastai.vision.all import *
|
| 3 |
import gradio as gr
|
| 4 |
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
learn = load_learner('model.pkl')
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def classify_image(img):
|
| 10 |
+
pred, idx, probs =learn.predict(img)
|
| 11 |
+
return dict(zip(categories, map(float, probs)))
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
image = gr.inputs.Image(shape=(192,192))
|
| 15 |
+
label = gr.outputs.Label()
|
| 16 |
+
|
| 17 |
+
intf = gr.Interface()
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7fe0cf40f824c2ef656c2875bcc0042168edcf82acba87f62578880c2c8130cf
|
| 3 |
+
size 46961967
|