M. Saad Munawar commited on
Commit
cf4755f
1 Parent(s): 0c1d92d

https://huggingface.co/spaces/Saad123/minimal

Browse files
Files changed (1) hide show
  1. app.py +4 -16
app.py CHANGED
@@ -1,17 +1,5 @@
1
- from fastai.vision.all import *
2
- def is_cat(x): return x[0].isupper()
3
- import pathlib
4
- plt = platform.system()
5
- if plt == 'Linux': pathlib.WindowsPath = pathlib.PosixPath
6
- learn=load_learner("CatvsDogmodel.pkl")
7
- categories=('Dog','Cat')
8
- def classify_image(img):
9
- pred, idx, probs = learn.predict(img)
10
- return dict(zip(categories, map(float,probs)))
11
  import gradio as gr
12
- imag=gr.inputs.Image(shape=(224, 224))
13
- im = imag/255
14
- image = np.reshape(im, [1,224,224,3])
15
- label=gr.outputs.Label()
16
- intf=gr.Interface(fn=classify_image, inputs=image, outputs=label)
17
- intf.launch(inline=False)
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ def hello(name):
3
+ return "Hello"+name
4
+ interface = gr.Interface(fn=hello, inputs='text', outputs='text')
5
+ interface.launch()