File size: 793 Bytes
3889369 |
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 26 27 28 |
import streamlit as st
import pickle
import numpy as np
# Define the path to your model file
MODEL_PATH = 'MODEL_PATH = 'cloth_recommendation (3).pkl'
'
# Load the trained model
with open(MODEL_PATH, 'rb') as f:
model = pickle.load(f)
# Function to predict size
def predict_size(height, weight, age):
return model.predict(np.array([[height, weight, age]]))[0]
# Streamlit UI
st.title('Size Prediction App')
st.write("Enter the following details to predict the size:")
height = st.number_input('Height (cm)', min_value=0.0, step=0.1)
weight = st.number_input('Weight (kg)', min_value=0.0, step=0.1)
age = st.number_input('Age (years)', min_value=0.0, step=0.1)
if st.button('Predict Size'):
size = predict_size(height, weight, age)
st.write(f'Predicted Size: {size:.2f}') |