edureyyy's picture
Create app.py
3d42840
raw
history blame
384 Bytes
!pip install Pillow
from fastai.vision.all import *
import gradio as gr
label = ['Cancer', 'No Cancer']
def classificador(im):
pred,idx,probs = learn.predict(im)
return dict(zip(label, map(float, probs)))
imatge = gr.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
intf = gr.Interface(fn=classificador, inputs = imatge, outputs = label)
intf.launch(inline=False)