edureyyy commited on
Commit
3d42840
1 Parent(s): c6dbd14

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !pip install Pillow
2
+ from fastai.vision.all import *
3
+ import gradio as gr
4
+
5
+ label = ['Cancer', 'No Cancer']
6
+
7
+ def classificador(im):
8
+ pred,idx,probs = learn.predict(im)
9
+ return dict(zip(label, map(float, probs)))
10
+
11
+
12
+ imatge = gr.inputs.Image(shape=(192,192))
13
+ label = gr.outputs.Label()
14
+
15
+ intf = gr.Interface(fn=classificador, inputs = imatge, outputs = label)
16
+ intf.launch(inline=False)