Spaces:
Sleeping
Sleeping
Added Streamlit interface for eval.py
Browse files
app.py
CHANGED
@@ -1,19 +1,25 @@
|
|
1 |
import streamlit as st
|
2 |
-
import
|
|
|
3 |
|
4 |
-
# Title
|
5 |
-
st.title("
|
6 |
-
st.write("This app interacts with the backend to generate output.")
|
7 |
|
8 |
-
# Input
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import os
|
3 |
+
import subprocess
|
4 |
|
5 |
+
# Title
|
6 |
+
st.title("Multimodal Garment Designer")
|
|
|
7 |
|
8 |
+
# Input fields
|
9 |
+
dataset_path = st.text_input("Dataset Path:", "./assets/data/dresscode")
|
10 |
+
output_dir = st.text_input("Output Directory:", "./output")
|
11 |
+
test_order = st.selectbox("Test Order:", ["paired", "unpaired"])
|
12 |
+
save_name = st.text_input("Save Name:", "model_output")
|
13 |
|
14 |
+
# Button to run the eval script
|
15 |
+
if st.button("Run Evaluation"):
|
16 |
+
# Construct the command
|
17 |
+
command = f"python eval.py --output_dir {output_dir} --dataset_path {dataset_path} --test_order {test_order} --save_name {save_name}"
|
18 |
|
19 |
+
# Run the command
|
20 |
+
with st.spinner("Running evaluation..."):
|
21 |
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
22 |
+
|
23 |
+
# Display the result
|
24 |
+
st.code(result.stdout)
|
25 |
+
st.code(result.stderr)
|