modernai commited on
Commit
c9804b6
·
1 Parent(s): 8942e58

added things

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -1,7 +1,15 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello sir or miss, nice to meet you " + name + "!!"
 
 
 
 
 
 
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ categories = {'dog', 'cat'}
4
+
5
+ def classify_image(img):
6
+ pred,idx,probs = learn.predict(img)
7
+ return dict(zip(categories,map(float(probs)))
8
+
9
+ image = gr.inputs.Image(shape=(192,192))
10
+ label = gr.outputs.Label()
11
+ examples = ['dog.jpg','cat.jpg','dunno.jpg']
12
+
13
+ intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
14
 
 
15
  iface.launch()