Bittar commited on
Commit
34f4f28
1 Parent(s): f6685d2
Files changed (4) hide show
  1. Octopus.jpg +0 -0
  2. Squid.jpg +0 -0
  3. app.py +12 -4
  4. model.pkl +3 -0
Octopus.jpg ADDED
Squid.jpg ADDED
app.py CHANGED
@@ -1,7 +1,15 @@
 
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
+ from fastai.vision.all import *
2
  import gradio as gr
3
+ def Octopus_or_Squid(x): return x[0].isupper()
4
 
5
+ learn = load_learner('model.pkl')
6
+ categories = ('Octopus','Squid')
7
+ def classify_image(img):
8
+ pred,idx,probs = learn.predict(img)
9
+ return dict(zip(categories,map(float,probs)))
10
 
11
+ image=gr.inputs.Image(shape=(192,192))
12
+ label=gr.outputs.Label()
13
+ examples=['Octopus.jpg','Squid.jpg']
14
+ intf=gr.Interface(fn=classify_image,inputs=image,outputs=label, examples=examples)
15
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9924f7bf04bfd587c89c6c418c95a94d827c07cf18380d72463016cc5e23562
3
+ size 46954777