Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import numpy as np
|
|
2 |
import pickle
|
3 |
import streamlit as st
|
4 |
import pandas as pd
|
|
|
5 |
|
6 |
# Loading the saved model
|
7 |
diabetes_model = pickle.load(open("diabetes_model.sav", 'rb'))
|
@@ -28,28 +29,6 @@ def main():
|
|
28 |
This proactive approach empowers individuals to take informed steps towards managing and preventing diabetes.
|
29 |
""")
|
30 |
|
31 |
-
# Theme toggle
|
32 |
-
theme = st.radio("Select Theme", ["Light", "Dark"], index=0)
|
33 |
-
|
34 |
-
# Conditional styling based on the theme selection
|
35 |
-
if theme == "Light":
|
36 |
-
st.markdown("""
|
37 |
-
<style>
|
38 |
-
.appview-container {
|
39 |
-
background-image: url('https://www.transparenttextures.com/patterns/white-wall.png');
|
40 |
-
background-size: cover;
|
41 |
-
}
|
42 |
-
</style>
|
43 |
-
""", unsafe_allow_html=True)
|
44 |
-
else:
|
45 |
-
st.markdown("""
|
46 |
-
<style>
|
47 |
-
.appview-container {
|
48 |
-
background-color: #2c2e35;
|
49 |
-
}
|
50 |
-
</style>
|
51 |
-
""", unsafe_allow_html=True)
|
52 |
-
|
53 |
# Getting the input data from the user
|
54 |
Pregnancies = st.number_input('Number of Pregnancies', min_value=0, max_value=20, step=1)
|
55 |
Glucose = st.number_input('Glucose Level', min_value=0, max_value=500, step=1)
|
@@ -105,5 +84,42 @@ def main():
|
|
105 |
pdf_contents = pdf_file.read()
|
106 |
st.download_button(label="Download PDF", data=pdf_contents, file_name="Research and Development.pdf", mime="application/pdf")
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
if __name__ == '__main__':
|
109 |
main()
|
|
|
2 |
import pickle
|
3 |
import streamlit as st
|
4 |
import pandas as pd
|
5 |
+
import altair as alt
|
6 |
|
7 |
# Loading the saved model
|
8 |
diabetes_model = pickle.load(open("diabetes_model.sav", 'rb'))
|
|
|
29 |
This proactive approach empowers individuals to take informed steps towards managing and preventing diabetes.
|
30 |
""")
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# Getting the input data from the user
|
33 |
Pregnancies = st.number_input('Number of Pregnancies', min_value=0, max_value=20, step=1)
|
34 |
Glucose = st.number_input('Glucose Level', min_value=0, max_value=500, step=1)
|
|
|
84 |
pdf_contents = pdf_file.read()
|
85 |
st.download_button(label="Download PDF", data=pdf_contents, file_name="Research and Development.pdf", mime="application/pdf")
|
86 |
|
87 |
+
|
88 |
+
# Determine the current Streamlit theme (light or dark)
|
89 |
+
theme = st.get_option("theme.base")
|
90 |
+
|
91 |
+
# Define button styling based on theme
|
92 |
+
if theme == "light":
|
93 |
+
button_bg_color = "#2c2e35"
|
94 |
+
button_border_color = "1px solid black"
|
95 |
+
button_text_color = "black"
|
96 |
+
else:
|
97 |
+
button_bg_color = "#2c2e35"
|
98 |
+
button_border_color = "1px solid #fff"
|
99 |
+
button_text_color = "#fff"
|
100 |
+
|
101 |
+
# Rounded button-like element with dynamic styling
|
102 |
+
st.markdown(f"""
|
103 |
+
<style>
|
104 |
+
.rounded-button {{
|
105 |
+
display: inline-block;
|
106 |
+
padding: 7px 15px;
|
107 |
+
font-size: 16px;
|
108 |
+
color: {button_text_color};
|
109 |
+
background-color: {button_bg_color};
|
110 |
+
border: {button_border_color};
|
111 |
+
border-radius: 7px;
|
112 |
+
text-align: center;
|
113 |
+
text-decoration: none;
|
114 |
+
cursor: default;
|
115 |
+
}}
|
116 |
+
</style>
|
117 |
+
<div style="text-align: center;">
|
118 |
+
<div class="rounded-button">
|
119 |
+
Developed by: Johnson Addo Ameyaw
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
""", unsafe_allow_html=True)
|
123 |
+
|
124 |
if __name__ == '__main__':
|
125 |
main()
|