Spaces:
Running
Running
SudheerNotes
commited on
Commit
•
ed34fe2
1
Parent(s):
23855c4
First Commit
Browse files- app.py +12 -0
- model_res_94_7.pkl +3 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import load_learner, PILImage
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
model = load_learner('model_res_94_7.pkl')
|
6 |
+
|
7 |
+
def prediction(img):
|
8 |
+
img_to_pred = PILImage.create(img)
|
9 |
+
res,pos,prob = model.predict(img)
|
10 |
+
return {res: format(prob[pos],'.4f')}
|
11 |
+
|
12 |
+
gr.Interface(fn=prediction,inputs="image",outputs="label").launch()
|
model_res_94_7.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:118f8ff2fec4400546f8e3154bc2df412f6ab8c39ce2e37f632f6261e6087a65
|
3 |
+
size 87682047
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fastai
|