File size: 809 Bytes
536f47f
 
 
 
 
7cb0aca
536f47f
 
7cb0aca
 
 
 
 
 
536f47f
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
from FFMI import plot_ffmi_curves

def main():
    st.title("FFMI Calculator")
    st.subheader('Fake or Natty judge.')
    st.write("This app visualizes FFMI curves based on weight and body fat percentage.")
    
    # Inputs for height and gender
    col1, col2 = st.columns(2)
    with col1:
        height_m = st.number_input("Enter your height in meters:", value=1.75, min_value=1.10, max_value=2.3, step=0.01)
    with col2:
        gender = st.selectbox("Select your gender", ["Male", "Female"])
    # Plot FFMI curves
    if st.button("Visualize FFMI Curves"):
        try:
            fig = plot_ffmi_curves(height_m, gender)
            st.plotly_chart(fig)
        except Exception as e:
            st.error(f"An error occurred: {e}")

if __name__ == "__main__":
    main()