awacke1 commited on
Commit
793e71c
·
1 Parent(s): 53d73ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -22,21 +22,21 @@ for uploaded_file in uploaded_files:
22
  uploaded_images[image_type][name].append(bytes_data)
23
  st.image(bytes_data, use_column_width=True)
24
 
25
- # Display character images on the left and terrain images on the right
26
- if uploaded_images['characters']:
27
- st.sidebar.write('**Characters**')
28
- for name, files in uploaded_images['characters'].items():
29
- for file in files:
30
- st.sidebar.image(file, width=100, caption=name)
31
-
32
- if uploaded_images['terrain']:
33
- st.write('**Terrain**')
34
- row = []
35
- for name, files in uploaded_images['terrain'].items():
36
- for file in files:
37
- row.append(file)
38
- if len(row) == 3:
39
- st.image(row, width=100 * 3)
40
- row = []
41
- if row:
42
- st.image(row, width=100 * len(row)) # Last row, if not complete
 
22
  uploaded_images[image_type][name].append(bytes_data)
23
  st.image(bytes_data, use_column_width=True)
24
 
25
+ if image_type == 'characters':
26
+ if uploaded_images['characters']:
27
+ st.sidebar.write('**Characters**')
28
+ for name, files in uploaded_images['characters'].items():
29
+ for file in files:
30
+ st.sidebar.image(file, width=100, caption=name)
31
+ else:
32
+ if uploaded_images['terrain']:
33
+ st.write('**Terrain**')
34
+ row = []
35
+ for name, files in uploaded_images['terrain'].items():
36
+ for file in files:
37
+ row.append(file)
38
+ if len(row) == 3:
39
+ st.image(row, width=100 * 3)
40
+ row = []
41
+ if row:
42
+ st.image(row, width=100 * len(row)) # Last row, if not complete