Spaces:
Sleeping
Sleeping
nishantguvvada
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,13 @@ st.write("""
|
|
23 |
"""
|
24 |
)
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
def model_prediction(age, height, weight, duration, heart_rate, body_temp, gender, model):
|
29 |
with st.spinner('Model is being loaded..'):
|
@@ -31,31 +37,11 @@ def model_prediction(age, height, weight, duration, heart_rate, body_temp, gende
|
|
31 |
predictions = model.predict(inputs)
|
32 |
st.write("""# Prediction : """ , predictions)
|
33 |
|
34 |
-
|
35 |
with st.sidebar:
|
36 |
st.markdown("<h2 style='text-align: center; color: red;'>Settings Tab</h2>", unsafe_allow_html=True)
|
37 |
|
38 |
-
|
39 |
st.write("Input Settings:")
|
40 |
|
41 |
-
#define the age for the model
|
42 |
-
age = st.slider('age :', 18, 80, 1)
|
43 |
-
|
44 |
-
#define the height for the model
|
45 |
-
height = st.slider('height :', 120.0, 230.0, 1.0)
|
46 |
-
|
47 |
-
#define the weight for the model
|
48 |
-
weight = st.slider('weight :', 35.0, 140.0, 1.0)
|
49 |
-
|
50 |
-
#define the duration for the model
|
51 |
-
duration = st.slider('duration :', 1.0, 30.0, 10.0)
|
52 |
-
|
53 |
-
#define the heart_rate for the model
|
54 |
-
heart_rate = st.slider('heart_rate :', 60.0, 130.0, 20.0)
|
55 |
-
|
56 |
-
#define the body_temp for the model
|
57 |
-
body_temp = st.slider('body_temp :', 35.0, 45.0, 1.0)
|
58 |
-
|
59 |
#define the gender for the model
|
60 |
gender_input = st.radio("gender", ["Male", "Female"], index=None)
|
61 |
if gender_input == "Male":
|
@@ -73,4 +59,4 @@ with st.sidebar:
|
|
73 |
|
74 |
with st.container():
|
75 |
if st.button("Calculate"):
|
76 |
-
model_prediction(age, height, weight, duration, heart_rate, body_temp, gender, model)
|
|
|
23 |
"""
|
24 |
)
|
25 |
|
26 |
+
#define the duration for the model
|
27 |
+
age = st.number_input('Input your age!', max_value=80, min_value=18, step=1)
|
28 |
+
duration = st.number_input('Input the amount of exercise time in minutes!', max_value=30.0, min_value=1.0, step=1.0)
|
29 |
+
height = st.number_input('Input your height!', max_value=230.0, min_value=120.0, step=1.0)
|
30 |
+
weight = st.number_input('Input your weight!', max_value=140.0, min_value=35.0, step=1.0)
|
31 |
+
heart_rate = st.number_input('Input your heart rate!', max_value=130.0, min_value=60.0, step=20.0)
|
32 |
+
body_temp = st.number_input('Input your body temperature!', max_value=45.0, min_value=35.0, step=1.0)
|
33 |
|
34 |
def model_prediction(age, height, weight, duration, heart_rate, body_temp, gender, model):
|
35 |
with st.spinner('Model is being loaded..'):
|
|
|
37 |
predictions = model.predict(inputs)
|
38 |
st.write("""# Prediction : """ , predictions)
|
39 |
|
|
|
40 |
with st.sidebar:
|
41 |
st.markdown("<h2 style='text-align: center; color: red;'>Settings Tab</h2>", unsafe_allow_html=True)
|
42 |
|
|
|
43 |
st.write("Input Settings:")
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
#define the gender for the model
|
46 |
gender_input = st.radio("gender", ["Male", "Female"], index=None)
|
47 |
if gender_input == "Male":
|
|
|
59 |
|
60 |
with st.container():
|
61 |
if st.button("Calculate"):
|
62 |
+
model_prediction(age, height, weight, duration, heart_rate, body_temp, gender, model)
|