This model will help in identifying if it is a lung ct scan or a brain ct scan. Recommended to use with fast.ai library!
STEPS:
- Download from the files area.
- import into your HuggingFace Repository.
- Install fast.ai (pip install fastai), from fastbook import *
- **load_learner('mode.pkl'), declare it to a variable. e.g: model = load_learner('mode.pkl')
- use, the variable declared, in this case, model, model.predict(input_image)
- For any queries, use this as a source code:
import gradio as gr from fastai.vision.all import * from fastbook import * def predict(input_img): categories = ('brain', 'lung') learn = load_learner('mode.pkl') pred,idx,probs = learn.predict(input_img) return dict(zip(categories, map(float,probs)))
label = gr.Label() gradio_app = gr.Interface( fn=predict, inputs=gr.Image(label="Select Image", sources=['upload', 'webcam'], type="pil"), outputs=label, title="Lung or Brain?", examples = ["brain.jpg","brainct.jpeg","images.jpeg","ctlung2.jpeg","images (1).jpeg"] )
if name == "main": gradio_app.launch()
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support