Mayel1233 commited on
Commit
d4d6160
1 Parent(s): 7458087
Files changed (6) hide show
  1. app.ipynb +0 -0
  2. app.py +21 -0
  3. basset.jpg +0 -0
  4. model.pkl +3 -0
  5. requirements.txt +5 -0
  6. train.ipynb +0 -0
app.ipynb ADDED
The diff for this file is too large to render. See raw diff
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+ import timm
4
+
5
+
6
+ learn = load_learner('model.pkl')
7
+ learn.predict(im)
8
+
9
+ categories = learn.dls.vocab
10
+
11
+ def classify_image(img):
12
+ pred,idx,probs = learn.predict(img)
13
+ return dict(zip(categories, map(float,probs)))
14
+
15
+ image = gr.inputs.Image(shape=(192, 192))
16
+ label = gr.outputs.Label()
17
+ examples = ['basset.jpg']
18
+
19
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
20
+ intf.launch(inline=False)
21
+
basset.jpg ADDED
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad467a1e20527493d865b8a3e45574e920bb82d84da146490ed67105c51c56f6
3
+ size 87641579
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ fastai
2
+ torch
3
+ gradio
4
+ numpy
5
+ pandas
train.ipynb ADDED
The diff for this file is too large to render. See raw diff