edureyyy's picture
Update app.py
ac9223c
raw
history blame
755 Bytes
import gradio as gr
pip install huggingface_hub["fastai"]
from huggingface_hub import from_pretrained_fastai
learn = from_pretrained_fastai("edureyyy/MamographyClassifier/ModelSuperKek.pkl")
#learn = load_learner('edureyyy/MamographyClassifier/ModelSuperKek.pkl')
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()
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' ]
intf = gr.Interface(fn=classificador, inputs = imatge, outputs = label)
intf.launch(inline=False)