giobin commited on
Commit
19ec3d7
·
verified ·
1 Parent(s): 60f83a0

trying to make the app visually better

Browse files
Files changed (1) hide show
  1. app.py +25 -7
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
- # Display content
114
  st.markdown("<h1 style='text-align: center; font-size: 50px;'>MAIA Sample</h1>", unsafe_allow_html=True)
115
- st.write(f"### User: {st.session_state.username}")
116
- st.write("\n\n\n") # Add empty space
 
 
 
 
 
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
- st.write(f"**Question Category:** {sample.get('question_category', 'No category available')}")
 
 
 
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
- st.button(f"Answer 1: {sample.get('answer1', 'No answer1 available')}", on_click=lambda: save_choice(0))
131
- st.button(f"Answer 2: {sample.get('answer2', 'No answer2 available')}", on_click=lambda: save_choice(1))
 
 
 
 
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))