Downloads · 30 days
0
RayhaanK/lung_or_brain
lung_or_brain is a machine learning model from RayhaanK. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
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!
Downloads · 30 days
0
Access
Public
Updated May 7, 2024
Repo size
47 MB
Likes
1
Public
Click a slice to open those files.
.pkl47 MB · 100%
From the Hugging Face model README
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:
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()