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("""
> You could segment you mri image. I hope it will find you well
""")
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("""
>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("""
Chest X-ray classifications
> We COVID19, NORMAL, PNEUMONIA,TURBERCULOSIS from your chest x-ray image
""")
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(
"""
These model is trained on the Kaggle dataset:
> Only for the educational purpose
> Play with that and Have fun.
""")
demo.launch()