Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,26 @@ import numpy as np
|
|
5 |
from PIL import Image
|
6 |
import base64
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
div[data-testid="stToolbar"] {
|
11 |
visibility: hidden;
|
12 |
height: 0%;
|
@@ -36,7 +54,7 @@ hide_streamlit_style = """
|
|
36 |
}
|
37 |
</style>
|
38 |
"""
|
39 |
-
st.markdown(
|
40 |
|
41 |
|
42 |
# Load the pre-trained model
|
@@ -75,11 +93,6 @@ def display_image_with_download(image_path, caption, download_text):
|
|
75 |
|
76 |
# Streamlit app
|
77 |
def main():
|
78 |
-
st.set_page_config(
|
79 |
-
page_title="Pneumonia Detection App",
|
80 |
-
page_icon=":microscope:",
|
81 |
-
layout="wide"
|
82 |
-
)
|
83 |
|
84 |
|
85 |
st.title("Pneumonia Detection")
|
@@ -109,7 +122,10 @@ def main():
|
|
109 |
display_image_with_download(normal_image_path, "Normal Image", "Normal Image")
|
110 |
|
111 |
if uploaded_file is not None:
|
|
|
112 |
st.image(uploaded_file, caption="Uploaded Image", use_column_width=True)
|
|
|
|
|
113 |
|
114 |
# Make predictions
|
115 |
prediction = predict_image(uploaded_file)
|
|
|
5 |
from PIL import Image
|
6 |
import base64
|
7 |
|
8 |
+
st.set_page_config(
|
9 |
+
page_title="Pneumonia Detection App",
|
10 |
+
page_icon=":microscope:",
|
11 |
+
layout="wide"
|
12 |
+
)
|
13 |
+
|
14 |
+
custom_style = """
|
15 |
<style>
|
16 |
+
.st-bw {
|
17 |
+
border-width: 2px !important;
|
18 |
+
border-color: #3498db !important;
|
19 |
+
border-radius: 10px !important;
|
20 |
+
padding: 10px !important;
|
21 |
+
box-shadow: 0px 0px 10px #888888 !important;
|
22 |
+
}
|
23 |
+
.stButton>button {
|
24 |
+
background-color: #3498db !important;
|
25 |
+
color: white !important;
|
26 |
+
border-radius: 5px !important;
|
27 |
+
}
|
28 |
div[data-testid="stToolbar"] {
|
29 |
visibility: hidden;
|
30 |
height: 0%;
|
|
|
54 |
}
|
55 |
</style>
|
56 |
"""
|
57 |
+
st.markdown(custom_style, unsafe_allow_html=True)
|
58 |
|
59 |
|
60 |
# Load the pre-trained model
|
|
|
93 |
|
94 |
# Streamlit app
|
95 |
def main():
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
|
98 |
st.title("Pneumonia Detection")
|
|
|
122 |
display_image_with_download(normal_image_path, "Normal Image", "Normal Image")
|
123 |
|
124 |
if uploaded_file is not None:
|
125 |
+
st.markdown('<div class="st-bw">', unsafe_allow_html=True)
|
126 |
st.image(uploaded_file, caption="Uploaded Image", use_column_width=True)
|
127 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
128 |
+
|
129 |
|
130 |
# Make predictions
|
131 |
prediction = predict_image(uploaded_file)
|