Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from utils.data_utils import load_dataset
|
| 3 |
+
from utils.model_utils import load_model, train_model
|
| 4 |
+
from utils.ui_utils import display_model_selection, display_training_method_selection, display_dataset_upload, display_model_details, display_training_progress
|
| 5 |
+
|
| 6 |
+
# Set the page title
|
| 7 |
+
st.title("FallnAI Trainer")
|
| 8 |
+
|
| 9 |
+
# Display the model selection dropdown
|
| 10 |
+
model = display_model_selection()
|
| 11 |
+
|
| 12 |
+
# Display the training method selection dropdown
|
| 13 |
+
training_method = display_training_method_selection()
|
| 14 |
+
|
| 15 |
+
# Display the dataset upload
|
| 16 |
+
uploaded_file = display_dataset_upload()
|
| 17 |
+
|
| 18 |
+
# Display the model details
|
| 19 |
+
display_model_details(model)
|
| 20 |
+
|
| 21 |
+
# Add a button to start training
|
| 22 |
+
if st.button("Train Model"):
|
| 23 |
+
# Load the model
|
| 24 |
+
model = load_model(model)
|
| 25 |
+
|
| 26 |
+
# Load the dataset
|
| 27 |
+
data = load_dataset(uploaded_file)
|
| 28 |
+
|
| 29 |
+
# Train the model
|
| 30 |
+
trained_model = train_model(model, data, training_method)
|
| 31 |
+
|
| 32 |
+
# Display the trained model
|
| 33 |
+
st.write("Trained Model:", trained_model)
|
| 34 |
+
|
| 35 |
+
# Display the training progress
|
| 36 |
+
display_training_progress(trained_model)
|