sreevidya16
commited on
Commit
•
3889369
1
Parent(s):
f381f6f
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pickle
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
# Define the path to your model file
|
6 |
+
MODEL_PATH = 'MODEL_PATH = 'cloth_recommendation (3).pkl'
|
7 |
+
'
|
8 |
+
|
9 |
+
# Load the trained model
|
10 |
+
with open(MODEL_PATH, 'rb') as f:
|
11 |
+
model = pickle.load(f)
|
12 |
+
|
13 |
+
# Function to predict size
|
14 |
+
def predict_size(height, weight, age):
|
15 |
+
return model.predict(np.array([[height, weight, age]]))[0]
|
16 |
+
|
17 |
+
# Streamlit UI
|
18 |
+
st.title('Size Prediction App')
|
19 |
+
|
20 |
+
st.write("Enter the following details to predict the size:")
|
21 |
+
|
22 |
+
height = st.number_input('Height (cm)', min_value=0.0, step=0.1)
|
23 |
+
weight = st.number_input('Weight (kg)', min_value=0.0, step=0.1)
|
24 |
+
age = st.number_input('Age (years)', min_value=0.0, step=0.1)
|
25 |
+
|
26 |
+
if st.button('Predict Size'):
|
27 |
+
size = predict_size(height, weight, age)
|
28 |
+
st.write(f'Predicted Size: {size:.2f}')
|