eaglelandsonce
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -343,33 +343,23 @@ with tab3:
|
|
343 |
|
344 |
if 'image_paths' in st.session_state and st.session_state['image_paths']:
|
345 |
# Create a slider for image selection
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
st.
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
for j in range(4):
|
367 |
-
idx = i + j
|
368 |
-
if idx < len(st.session_state['image_paths']):
|
369 |
-
with cols[j]:
|
370 |
-
st.image(st.session_state['image_paths'][idx], use_column_width=True)
|
371 |
-
if st.button(f"Details {idx}", key=f"button_{idx}"):
|
372 |
-
st.write(f"You clicked on image {idx}")
|
373 |
-
# Add more actions for the click event here
|
374 |
-
|
375 |
-
'''
|
|
|
343 |
|
344 |
if 'image_paths' in st.session_state and st.session_state['image_paths']:
|
345 |
# Create a slider for image selection
|
346 |
+
|
347 |
+
col1, col2, col3 = st.columns([1, 3, 1])
|
348 |
+
|
349 |
+
with col2:
|
350 |
+
image_index = st.select_slider(
|
351 |
+
"Choose an image",
|
352 |
+
options=list(range(len(st.session_state['image_paths']))),
|
353 |
+
format_func=lambda x: f"Image {x + 1}"
|
354 |
+
)
|
355 |
+
|
356 |
+
# Display the selected image
|
357 |
+
image_width = 400
|
358 |
+
st.image(st.session_state['image_paths'][image_index])
|
359 |
+
|
360 |
+
# Button for actions related to the selected image
|
361 |
+
if st.button("Details", key=f"details_{image_index}"):
|
362 |
+
st.write(f"You clicked on image {image_index + 1}")
|
363 |
+
# Add more actions for the click event here
|
364 |
+
|
365 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|