Spaces:
Runtime error
Runtime error
File size: 781 Bytes
b61cbdb 51e5e3f 50b414a b61cbdb abdff05 b61cbdb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
from fastai.learner import load_learner
from transformers import AutoTokenizer, AutoModelForSequenceClassification
#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) |