selva1909 commited on
Commit
fd992bf
·
verified ·
1 Parent(s): efdad1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -22
app.py CHANGED
@@ -34,34 +34,17 @@ custom_css = """
34
  .gr-box {background-color: #2C3E50; padding: 10px; border-radius: 10px;}
35
  """
36
 
37
- description = """
38
- 🧠 **Brain Tumor Detector**
39
- Upload an MRI scan to classify brain tumors using deep learning.
40
- 💡 **Supports:** Glioma | Meningioma | No Tumor | Pituitary
41
- 🚀 **Fast & Accurate AI Model**
42
- """
43
-
44
- with gr.Blocks() as interface:
45
- gr.HTML("<img src='Figure 2025-01-07 031757 (8).png' style='width:100px; position:absolute; top:10px; left:10px;'>")
46
- gr.Markdown("## Brain Tumor Detection 🧠")
47
- image = gr.Image(type="pil", label="Upload Brain MRI")
48
- output = gr.Textbox(label="Prediction")
49
- btn = gr.Button("Predict")
50
-
51
- btn.click(predict, inputs=image, outputs=output)
52
-
53
- # UI Interface
54
  interface = gr.Interface(
55
  fn=predict,
56
  inputs=gr.Image(type="pil", label="Upload Brain MRI"),
57
  outputs=gr.Textbox(label="Prediction"),
58
  title="Brain Tumor Detection 🧠",
59
- description="Upload an MRI scan to classify brain tumors using deep learning.",
60
  theme="default",
61
- css=custom_css,
62
- examples=["/mnt/data/2.webp"] # Use the uploaded image as an example
63
  )
64
 
65
  # Launch the app
66
- interface.launch()
67
-
 
34
  .gr-box {background-color: #2C3E50; padding: 10px; border-radius: 10px;}
35
  """
36
 
37
+ # Final Gradio interface
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  interface = gr.Interface(
39
  fn=predict,
40
  inputs=gr.Image(type="pil", label="Upload Brain MRI"),
41
  outputs=gr.Textbox(label="Prediction"),
42
  title="Brain Tumor Detection 🧠",
43
+ description="Upload an MRI scan to classify brain tumors into Glioma, Meningioma, Pituitary, or No Tumor.",
44
  theme="default",
45
+ css=custom_css
 
46
  )
47
 
48
  # Launch the app
49
+ if __name__ == "__main__":
50
+ interface.launch()