Fake-or-Natty / app.py
WillzWayn's picture
Fixed hovertext
9f95049
raw
history blame contribute delete
809 Bytes
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()