Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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)
|