Mairaaa commited on
Commit
af894bb
·
1 Parent(s): 458eaee

Added Streamlit interface for eval.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
app.py CHANGED
@@ -1,19 +1,25 @@
1
  import streamlit as st
2
- import requests
 
3
 
4
- # Title of the app
5
- st.title("Backend API Test")
6
- st.write("This app interacts with the backend to generate output.")
7
 
8
- # Input from the user
9
- input_data = st.text_input("Enter Input Data:", "")
 
 
 
10
 
11
- if st.button("Generate"):
12
- # Make a POST request to your backend
13
- response = requests.post("http://127.0.0.1:8000/predict", json={"input_data": input_data})
 
14
 
15
- # Handle the response
16
- if response.status_code == 200:
17
- st.write("Result:", response.json().get("result", "No result found"))
18
- else:
19
- st.error(f"Error: {response.status_code} - {response.text}")
 
 
 
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)