Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,21 @@ def predict_image(image):
|
|
34 |
else:
|
35 |
return f'Tumor detected. Confidence: {confidence:.2f}'
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
# Create the Gradio interface
|
38 |
iface = gr.Interface(
|
39 |
fn=predict_image,
|
@@ -41,8 +56,12 @@ iface = gr.Interface(
|
|
41 |
outputs=gr.Textbox(),
|
42 |
title="Brain Tumor Detection AI App",
|
43 |
description="Upload an image to detect brain tumors.",
|
|
|
|
|
|
|
|
|
44 |
)
|
45 |
|
46 |
# Launch the interface
|
47 |
-
iface.launch()
|
48 |
|
|
|
34 |
else:
|
35 |
return f'Tumor detected. Confidence: {confidence:.2f}'
|
36 |
|
37 |
+
# Create custom CSS for background color
|
38 |
+
#css = """
|
39 |
+
#body {
|
40 |
+
# background-color: dark;
|
41 |
+
#}
|
42 |
+
#"""
|
43 |
+
|
44 |
+
# Provide example images (these should be paths to valid images)
|
45 |
+
examples = [
|
46 |
+
["/content/drive/MyDrive/archive/brain_tumor_dataset/no/1 no.jpeg"], # Replace with actual example image paths
|
47 |
+
["/content/drive/MyDrive/archive/brain_tumor_dataset/yes/Y1.jpg"],
|
48 |
+
["/content/drive/MyDrive/archive/brain_tumor_dataset/no/15 no.jpg"],
|
49 |
+
["/content/drive/MyDrive/archive/brain_tumor_dataset/yes/Y104.jpg"]
|
50 |
+
]
|
51 |
+
|
52 |
# Create the Gradio interface
|
53 |
iface = gr.Interface(
|
54 |
fn=predict_image,
|
|
|
56 |
outputs=gr.Textbox(),
|
57 |
title="Brain Tumor Detection AI App",
|
58 |
description="Upload an image to detect brain tumors.",
|
59 |
+
#css=css, # Apply the custom background color
|
60 |
+
theme="monochrome", # Apply a dark theme to the interface
|
61 |
+
flagging_options=["Incorrect Diagnosis", "Image Not Clear", "Model Error"], # Add flagging options
|
62 |
+
examples=examples # Include 4 example images
|
63 |
)
|
64 |
|
65 |
# Launch the interface
|
66 |
+
iface.launch(share=True,debug=True)
|
67 |
|