Cathaltwo commited on
Commit
86cc325
·
1 Parent(s): 2cb2d6d

Add application file

Browse files
Cat_November_2010-1a.jpg ADDED
Cat_November_2010-1a.jpgZone.Identifier ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [ZoneTransfer]
2
+ ZoneId=3
3
+ ReferrerUrl=https://www.google.com/
4
+ HostUrl=https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/1200px-Cat_November_2010-1a.jpg
app.py CHANGED
@@ -1,7 +1,18 @@
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
  import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ def is_cat(x): return x[0].isupper()
5
+ learn =load_learner ('model.pkl')
6
+ categories =['dog','Cat']
7
+ def classify_image(img):
8
+ pred,idx,probs = learn.predict(img)
9
+ return dict(zip(categories,map(float,probs)))
10
 
11
  def greet(name):
12
  return "Hello " + name + "!!"
13
 
14
+ image=gr.inputs.Image(shape=(192,192))
15
+ label =gr.outputs.Label()
16
+ examples = ['dog.jpg','Cat_November_2010-1a.jpg']
17
+ intf =gr.Interface(fn=classify_image,inputs =image,outputs=label,examples=examples)
18
+ intf.launch()
dog.jpg ADDED
dog.jpgZone.Identifier ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [ZoneTransfer]
2
+ ZoneId=3
3
+ ReferrerUrl=https://www.google.com/
4
+ HostUrl=https://hips.hearstapps.com/hmg-prod/images/dog-puppy-on-garden-royalty-free-image-1586966191.jpg?crop=0.752xw:1.00xh;0.175xw,0&resize=1200:*
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b30780fbb568ad440d2fc81f78d6a17f73bfca2d594dcffa016ba76a8edafa5
3
+ size 47056209
model.pklZone.Identifier ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [ZoneTransfer]
2
+ ZoneId=3
3
+ HostUrl=about:internet