lopesdri commited on
Commit
00ab10d
·
1 Parent(s): a8a3599

Upload 3 files

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. app.py +24 -4
  3. dog.jpg +3 -0
  4. pets.pkl +3 -0
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ dog.jpg filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,7 +1,27 @@
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../drive/MyDrive/Colab Notebooks/cats_vs_dogs.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
5
+
6
+ # %% ../drive/MyDrive/Colab Notebooks/cats_vs_dogs.ipynb 10
7
+ !pip install -q gradio
8
  import gradio as gr
9
 
10
+ # %% ../drive/MyDrive/Colab Notebooks/cats_vs_dogs.ipynb 12
11
+ learn = load_learner('pets.pkl')
12
+
13
+ # %% ../drive/MyDrive/Colab Notebooks/cats_vs_dogs.ipynb 14
14
+ categories = ('Dog', 'Cat')
15
+
16
+ def classify_image(img):
17
+ pred,idx,probs = learn.predict(img)
18
+ return dict(zip(categories, map(float,probs)))
19
+ classify_image(im)
20
+
21
+ # %% ../drive/MyDrive/Colab Notebooks/cats_vs_dogs.ipynb 15
22
+ image = gr.inputs.Image(shape=(192, 192))
23
+ label = gr.outputs.Label()
24
+ examples = ['dog.jpg']
25
 
26
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
27
+ intf.launch(inline=False)
dog.jpg ADDED

Git LFS Details

  • SHA256: fd16932fae31cf6c36cc797a3f2a1e75dc6410f5371a621a27dfa740df28a13e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.89 MB
pets.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86e85227fa293cf98739dc3643f912de639fd70347a01e544dab8d7c43349854
3
+ size 102978534