kivilaid commited on
Commit
70ba7a0
·
1 Parent(s): 13edc61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -23,9 +23,14 @@ def main():
23
  image = Image.open(uploaded_file)
24
  st.session_state.images.append(image)
25
 
26
- # Display images
27
- for idx, img in enumerate(st.session_state.images, start=1):
28
- st.image(img, caption=f"Image {idx}", use_column_width=True)
 
 
 
 
 
29
 
30
  # Reset button
31
  if st.button('Reset and Start Over'):
 
23
  image = Image.open(uploaded_file)
24
  st.session_state.images.append(image)
25
 
26
+ # Display images in a grid
27
+ cols_per_row = 4
28
+ for i in range(0, len(st.session_state.images), cols_per_row):
29
+ cols = st.columns(cols_per_row)
30
+ for j in range(cols_per_row):
31
+ if i + j < len(st.session_state.images):
32
+ with cols[j]:
33
+ st.image(st.session_state.images[i + j], caption=f"Image {i + j + 1}", use_column_width=True)
34
 
35
  # Reset button
36
  if st.button('Reset and Start Over'):