jph00 commited on
Commit
489d8b7
1 Parent(s): 7d792ca
Files changed (7) hide show
  1. .gitattributes +2 -0
  2. README.md +3 -3
  3. app.ipynb +0 -0
  4. app.py +27 -0
  5. basset.jpg +3 -0
  6. model.pkl +3 -0
  7. requirements.txt +3 -0
.gitattributes CHANGED
@@ -25,3 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
+ *.jpg filter=lfs diff=lfs merge=lfs -text
29
+ *.pkl filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
- title: Pets
3
- emoji: 🐠
4
  colorFrom: pink
5
- colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 2.9.4
8
  app_file: app.py
 
1
  ---
2
+ title: Testing
3
+ emoji: 🦀
4
  colorFrom: pink
5
+ colorTo: blue
6
  sdk: gradio
7
  sdk_version: 2.9.4
8
  app_file: app.py
app.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
2
+
3
+ __all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
4
+
5
+ # Cell
6
+ from fastai.vision.all import *
7
+ import gradio as gr
8
+ import timm
9
+
10
+ # Cell
11
+ learn = load_learner('model.pkl')
12
+
13
+ # Cell
14
+ categories = learn.dls.vocab
15
+
16
+ def classify_image(img):
17
+ pred,idx,probs = learn.predict(img)
18
+ return dict(zip(categories, map(float,probs)))
19
+
20
+ # Cell
21
+ image = gr.inputs.Image(shape=(192, 192))
22
+ label = gr.outputs.Label()
23
+ examples = ['basset.jpg']
24
+
25
+ # Cell
26
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
27
+ intf.launch()
basset.jpg ADDED

Git LFS Details

  • SHA256: d4cb7457aedd287819ba4da40fd0adbac9447c09eb3b33416f9a1594c21126b1
  • Pointer size: 130 Bytes
  • Size of remote file: 74.8 kB
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e80ba1eb22a56fe24fe9ec809c75e588b780df5cd98989d229511acc2089038
3
+ size 348728037
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ fastai
2
+ timm
3
+