Update app.py
Browse files
app.py
CHANGED
@@ -97,8 +97,9 @@ visualization_images = [
|
|
97 |
def display_visualizations():
|
98 |
return [Image.open(image) for image in visualization_images]
|
99 |
|
100 |
-
# Custom CSS to enhance appearance
|
101 |
custom_css = """
|
|
|
102 |
body {
|
103 |
font-family: 'Arial', sans-serif;
|
104 |
background-color: #f5f5f5;
|
@@ -139,6 +140,7 @@ custom_css = """
|
|
139 |
color: #007bff;
|
140 |
font-weight: bold;
|
141 |
}
|
|
|
142 |
"""
|
143 |
|
144 |
# Create Gradio interfaces
|
@@ -148,8 +150,11 @@ prediction_interface = gr.Interface(
|
|
148 |
outputs=gr.Label(label="Predicted Disease"),
|
149 |
examples=examples,
|
150 |
title="Lung Disease Detection XVI",
|
151 |
-
description="
|
152 |
-
|
|
|
|
|
|
|
153 |
)
|
154 |
|
155 |
visualization_interface = gr.Interface(
|
@@ -157,8 +162,10 @@ visualization_interface = gr.Interface(
|
|
157 |
inputs=None,
|
158 |
outputs=[gr.Image(label=f"Visualization {i+1}") for i in range(len(visualization_images))],
|
159 |
title="Model Performance Visualizations",
|
160 |
-
description="
|
161 |
-
|
|
|
|
|
162 |
)
|
163 |
|
164 |
# Combine interfaces into a tabbed interface
|
@@ -167,5 +174,5 @@ app = gr.TabbedInterface(
|
|
167 |
tab_names=["Predict", "Model Performance"]
|
168 |
)
|
169 |
|
170 |
-
# Launch the interface
|
171 |
-
app.launch(share=True
|
|
|
97 |
def display_visualizations():
|
98 |
return [Image.open(image) for image in visualization_images]
|
99 |
|
100 |
+
# Custom CSS to enhance appearance (injected via HTML)
|
101 |
custom_css = """
|
102 |
+
<style>
|
103 |
body {
|
104 |
font-family: 'Arial', sans-serif;
|
105 |
background-color: #f5f5f5;
|
|
|
140 |
color: #007bff;
|
141 |
font-weight: bold;
|
142 |
}
|
143 |
+
</style>
|
144 |
"""
|
145 |
|
146 |
# Create Gradio interfaces
|
|
|
150 |
outputs=gr.Label(label="Predicted Disease"),
|
151 |
examples=examples,
|
152 |
title="Lung Disease Detection XVI",
|
153 |
+
description=f"""
|
154 |
+
Upload a chest X-ray image to detect lung diseases such as 🦠 COVID-19, 🦠 Pneumonia, 🫁 Normal, or 🦠 TB.
|
155 |
+
Use the example images to see how the model works.
|
156 |
+
{custom_css}
|
157 |
+
"""
|
158 |
)
|
159 |
|
160 |
visualization_interface = gr.Interface(
|
|
|
162 |
inputs=None,
|
163 |
outputs=[gr.Image(label=f"Visualization {i+1}") for i in range(len(visualization_images))],
|
164 |
title="Model Performance Visualizations",
|
165 |
+
description=f"""
|
166 |
+
Here are some visualizations that depict the performance of the model during training and testing.
|
167 |
+
{custom_css}
|
168 |
+
"""
|
169 |
)
|
170 |
|
171 |
# Combine interfaces into a tabbed interface
|
|
|
174 |
tab_names=["Predict", "Model Performance"]
|
175 |
)
|
176 |
|
177 |
+
# Launch the interface
|
178 |
+
app.launch(share=True)
|