Spaces:
Running
Running
Update app.py - add description regarding the Modes. Use example caption by default.
Browse files
app.py
CHANGED
@@ -20,32 +20,32 @@ def preprocess_captions(generated_captions, reference_captions):
|
|
20 |
# Streamlit app
|
21 |
def main():
|
22 |
st.title("iSPICE Metric Evaluation")
|
23 |
-
|
24 |
# Dropdown for comparison option
|
25 |
mode = st.selectbox("Mode:", ["ID", "Name"])
|
26 |
|
27 |
spice_scorer = Spice(mode=mode)
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
# Sample examples dropdown
|
30 |
st.sidebar.subheader("Choose Sample Example:")
|
31 |
-
example_choice = st.sidebar.selectbox("Select Example",
|
32 |
|
33 |
-
# Initialize with empty strings
|
34 |
-
generated_caption = ""
|
35 |
-
reference_caption = ""
|
36 |
|
37 |
# Description
|
38 |
st.write("You can either input single caption or multiple captions separated by new line.")
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
else:
|
46 |
-
# Input text boxes
|
47 |
-
generated_caption_input = st.text_area("Generated Caption:")
|
48 |
-
reference_caption_input = st.text_area("Reference Caption:")
|
49 |
|
50 |
|
51 |
# Compute score button
|
|
|
20 |
# Streamlit app
|
21 |
def main():
|
22 |
st.title("iSPICE Metric Evaluation")
|
23 |
+
|
24 |
# Dropdown for comparison option
|
25 |
mode = st.selectbox("Mode:", ["ID", "Name"])
|
26 |
|
27 |
spice_scorer = Spice(mode=mode)
|
28 |
|
29 |
+
# Note on how to use the app
|
30 |
+
id_label = r'''If you choose the Mode as ID, supported Person IDs are from P1, P2, P3 .. upto P11.'''
|
31 |
+
name_label = r'''If you choose the Mode as Name, supported Person Names are - Ray, Sam, Casey, Riley, Morgan, Alex, Quinn, Cameron, Avery, Charlie, Jamie and Mike.'''
|
32 |
+
|
33 |
+
st.caption(id_label)
|
34 |
+
st.caption(name_label)
|
35 |
+
|
36 |
# Sample examples dropdown
|
37 |
st.sidebar.subheader("Choose Sample Example:")
|
38 |
+
example_choice = st.sidebar.selectbox("Select Example", list(sample_examples.keys()))
|
39 |
|
|
|
|
|
|
|
40 |
|
41 |
# Description
|
42 |
st.write("You can either input single caption or multiple captions separated by new line.")
|
43 |
+
generated_caption = sample_examples[example_choice]["generated"]
|
44 |
+
reference_caption = sample_examples[example_choice]["reference"]
|
45 |
+
generated_caption_input = st.text_area("Generated Caption:", value=generated_caption)
|
46 |
+
reference_caption_input = st.text_area("Reference Caption:", value=reference_caption)
|
47 |
+
|
48 |
+
st.caption("We have a default caption here you can try out. You can modify it as required.")
|
|
|
|
|
|
|
|
|
49 |
|
50 |
|
51 |
# Compute score button
|