eaglelandsonce commited on
Commit
ccbd684
·
verified ·
1 Parent(s): 010459d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -30
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
- image_index = st.select_slider(
347
- "Choose an image",
348
- options=list(range(len(st.session_state['image_paths']))),
349
- format_func=lambda x: f"Image {x + 1}"
350
- )
351
-
352
- # Display the selected image
353
- image_width = 400
354
- st.image(st.session_state['image_paths'][image_index], width=image_width)
355
-
356
- # Button for actions related to the selected image
357
- if st.button("Details", key=f"details_{image_index}"):
358
- st.write(f"You clicked on image {image_index + 1}")
359
- # Add more actions for the click event here
360
-
361
-
362
- '''
363
- if 'image_paths' in st.session_state:
364
- for i in range(0, len(st.session_state['image_paths']), 4):
365
- cols = st.columns(4)
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
+