Spaces:
Build error
Build error
trying to make the app visually better
Browse files
app.py
CHANGED
|
@@ -110,22 +110,40 @@ def save_choice(choice_index):
|
|
| 110 |
# Select the current sample
|
| 111 |
sample = dataset.iloc[st.session_state.index]
|
| 112 |
|
| 113 |
-
#
|
| 114 |
st.markdown("<h1 style='text-align: center; font-size: 50px;'>MAIA Sample</h1>", unsafe_allow_html=True)
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
st.markdown("""
|
| 118 |
### Instructions:
|
| 119 |
- Look at the video thumbnail, do not play it!
|
| 120 |
- Select the checkbox if you think so.
|
| 121 |
- Then choose one of the two answers.
|
| 122 |
""")
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
| 124 |
st.video(sample["video_url"])
|
| 125 |
|
|
|
|
|
|
|
|
|
|
| 126 |
# Checkbox for uncertainty
|
|
|
|
| 127 |
not_enough_info = st.checkbox("The frame does not provide enough information to answer the question.", key='checkbox')
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
# Buttons
|
| 130 |
-
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
# Select the current sample
|
| 111 |
sample = dataset.iloc[st.session_state.index]
|
| 112 |
|
| 113 |
+
# Title
|
| 114 |
st.markdown("<h1 style='text-align: center; font-size: 50px;'>MAIA Sample</h1>", unsafe_allow_html=True)
|
| 115 |
+
|
| 116 |
+
# Centered user name
|
| 117 |
+
st.markdown(f"<h3 style='text-align: center;'>User: {st.session_state.username}</h3>", unsafe_allow_html=True)
|
| 118 |
+
|
| 119 |
+
st.write("\n\n") # Add empty space
|
| 120 |
+
|
| 121 |
+
# Instructions
|
| 122 |
st.markdown("""
|
| 123 |
### Instructions:
|
| 124 |
- Look at the video thumbnail, do not play it!
|
| 125 |
- Select the checkbox if you think so.
|
| 126 |
- Then choose one of the two answers.
|
| 127 |
""")
|
| 128 |
+
|
| 129 |
+
st.write("---") # Adds a horizontal divider for better separation
|
| 130 |
+
|
| 131 |
+
# Display Video
|
| 132 |
st.video(sample["video_url"])
|
| 133 |
|
| 134 |
+
# Question Prompt
|
| 135 |
+
st.markdown("<h4 style='text-align: center; margin-top: 20px;'>Scegli la descrizione corretta tra A e B</h4>", unsafe_allow_html=True)
|
| 136 |
+
|
| 137 |
# Checkbox for uncertainty
|
| 138 |
+
st.markdown("<div style='text-align: center;'>", unsafe_allow_html=True)
|
| 139 |
not_enough_info = st.checkbox("The frame does not provide enough information to answer the question.", key='checkbox')
|
| 140 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 141 |
+
|
| 142 |
+
st.write("\n") # Add spacing before buttons
|
| 143 |
|
| 144 |
+
# Buttons (Centered)
|
| 145 |
+
col1, col2 = st.columns(2)
|
| 146 |
+
with col1:
|
| 147 |
+
st.button(f"A: {sample.get('answer1', 'No answer1 available')}", on_click=lambda: save_choice(0))
|
| 148 |
+
with col2:
|
| 149 |
+
st.button(f"B: {sample.get('answer2', 'No answer2 available')}", on_click=lambda: save_choice(1))
|