Spaces:
Sleeping
Sleeping
import gradio as gr | |
from predict import makepredictions, xray_predict | |
from tumorseg import make_segmentation | |
with gr.Blocks() as demo: | |
with gr.Tab('Brain Tumor | Tumor Segmentation'): | |
gr.Markdown(""" | |
<div align='center'>Tumor segmentations | |
</div> | |
<div align='center'> | |
> You could segment you mri image. I hope it will find you well | |
</div> | |
""") | |
with gr.Row(): | |
image_input = gr.Image(label='Tumor Image', type='filepath', height=480, interactive=True) | |
output_image = gr.Image(label='label Segmented Image', height=480, interactive=False) | |
image_button = gr.Button("Segment image") | |
image_button.click(make_segmentation, inputs=image_input, outputs=output_image) | |
with gr.Tab('Brain Tumor | Tumor Classification'): | |
gr.Markdown(""" | |
<div align='center'> | |
Brain Tumor Image classification | |
</div> | |
<div align='center'> | |
>We detect 4 Types of Tumor with 99.12% Accuracy: | |
>Glioma | Meningioma | No Tumor | Pituitary | |
""") | |
image_input = gr.Image(label='Tumor Image', type='filepath', height=480) | |
with gr.Row(): | |
image_button = gr.Button("Predict") | |
y_pred = gr.Textbox(label="Tumor Type:") | |
image_button.click(makepredictions, inputs=image_input, outputs=y_pred) | |
with gr.Tab('Chest X-ray | COVID19, NORMAL, PNEUMONIA,TURBERCULOSIS'): | |
gr.Markdown(""" | |
<div align='center'>Chest X-ray classifications | |
</div> | |
<div align='center'> | |
> We COVID19, NORMAL, PNEUMONIA,TURBERCULOSIS from your chest x-ray image | |
</div> | |
""") | |
image_input = gr.Image(label='Chest X-ray', type='filepath', height=480) | |
with gr.Row(): | |
image_button = gr.Button("Predict") | |
y_pred = gr.Textbox(label="Disease :") | |
image_button.click(xray_predict, inputs=image_input, outputs=[y_pred]) | |
gr.Markdown( | |
""" | |
<div align='center'> | |
These model is trained on the Kaggle dataset: | |
</div> | |
<div align='center'> | |
> Only for the educational purpose | |
> Play with that and Have fun. | |
</div> | |
""") | |
demo.launch() | |