jph00 commited on
Commit
689caa8
·
1 Parent(s): 57f9a99
Files changed (5) hide show
  1. app.py +5 -6
  2. basset.jpg +0 -0
  3. model.pkl +3 -0
  4. requirements.txt +6 -0
  5. train.ipynb +0 -0
app.py CHANGED
@@ -1,9 +1,8 @@
1
- __all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
2
-
3
  # Cell
 
4
  from fastai.vision.all import *
5
  import gradio as gr
6
- import timm
7
 
8
  # Cell
9
  learn = load_learner('model.pkl')
@@ -16,10 +15,10 @@ def classify_image(img):
16
  return dict(zip(categories, map(float,probs)))
17
 
18
  # Cell
19
- image = gr.inputs.Image(shape=(192, 192))
20
- label = gr.outputs.Label()
21
  examples = ['basset.jpg']
22
 
23
  # Cell
24
- intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
25
  intf.launch()
 
 
 
1
  # Cell
2
+ import timm
3
  from fastai.vision.all import *
4
  import gradio as gr
5
+
6
 
7
  # Cell
8
  learn = load_learner('model.pkl')
 
15
  return dict(zip(categories, map(float,probs)))
16
 
17
  # Cell
18
+ # image = gr.inputs.Image(shape=(192, 192))
19
+ # label = gr.outputs.Label()
20
  examples = ['basset.jpg']
21
 
22
  # Cell
23
+ intf = gr.Interface(fn=classify_image, inputs="image", outputs="label", examples=examples)
24
  intf.launch()
basset.jpg ADDED
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac4c78562eb14301758dd0e0810e7fce619a97d5968660a503106cf902d75cf5
3
+ size 114782899
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ fastai
2
+ gradio==3.34.0
3
+ timm==0.6.13
4
+ torch==2.0.1
5
+ torchvision==0.15.2
6
+ torch==1.12.1
train.ipynb ADDED
The diff for this file is too large to render. See raw diff