igalilea commited on
Commit
e51b87e
1 Parent(s): 8c0fc3d

Añadida la nueva app y el modelo

Browse files
Files changed (2) hide show
  1. app.py +23 -4
  2. model.pkl +3 -0
app.py CHANGED
@@ -1,7 +1,26 @@
 
 
 
 
 
 
 
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/app.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['learn', 'categories', 'image', 'label', 'intf', 'classify_image']
5
+
6
+ # %% ../drive/MyDrive/Colab Notebooks/app.ipynb 2
7
+ from fastai.vision.all import *
8
  import gradio as gr
9
 
10
+ # %% ../drive/MyDrive/Colab Notebooks/app.ipynb 4
11
+ learn = load_learner('/content/drive/MyDrive/assets/model.pkl')
12
+
13
+ # %% ../drive/MyDrive/Colab Notebooks/app.ipynb 5
14
+ categories = ('Dog', 'Cat')
15
+
16
+ def classify_image(img):
17
+ pred,idx,probs = learn.predict(img)
18
+ return dict(zip(categories, map(floats, probs)))
19
+
20
+
21
+ # %% ../drive/MyDrive/Colab Notebooks/app.ipynb 6
22
+ image = gr.inputs.Image(shape=(192,192))
23
+ label = gr.outputs.Label()
24
 
25
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
26
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19b31fc2a1aeadca6272dd42b40bdbc45de070db32d317ab7b4f7e4c53b7fc29
3
+ size 47061483