Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
learn = load_learner('/kaggle/input/models/ModelSuperKek.pkl')
|
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 |
+
imatge = gr.inputs.Image(shape=(192,192))
|
12 |
+
label = gr.outputs.Label()
|
13 |
+
example = ['/kaggle/input/rsna22-bal/rsna22_bal/rsna22_bal/images_png/12305_1995339680_L.png', '/kaggle/input/rsna22-bal/rsna22_bal/rsna22_bal/images_png/10234_173054723_L.png' ]
|
14 |
+
|
15 |
+
intf = gr.Interface(fn=classificador, inputs = imatge, outputs = label)
|
16 |
+
intf.launch(inline=False)
|