Spaces:
Build error
Build error
| import gradio as gr | |
| from fastai.vision.all import * | |
| import skimage | |
| learn = load_learner('export.pkl') | |
| labels = learn.dls.vocab | |
| def predict(img): | |
| img = PILImage.create(img) | |
| pred,pred_idx,probs = learn.predict(img) | |
| return {labels[i]: float(probs[i]) for i in range(len(labels))} | |
| title = "Oral diseases Classifier" | |
| description = "A Oral diseases classifier trained on the oral disease dataset with fastai. Created as a demo for diatex." | |
| examples = ['ulc.jpeg','hypo1.jpeg','gingi.jpeg','discol2.jpeg', 'cari.jpeg', 'calc3.jpeg'] | |
| # interpretation='default' | |
| # enable_queue=True | |
| # article=article,examples=examples | |
| gr.Interface(fn=predict,inputs=gr.Image(),outputs=gr.Label(num_top_classes=6),examples=examples,title=title,description=description).launch() |