Update app.py
Browse files
app.py
CHANGED
|
@@ -29,13 +29,10 @@ def get_uploaded_files_info():
|
|
| 29 |
|
| 30 |
def display_images_from_csv():
|
| 31 |
files_info = get_uploaded_files_info()
|
| 32 |
-
sidebar_images = []
|
| 33 |
for row in files_info:
|
| 34 |
if row[2] == 'characters':
|
| 35 |
img_path = f"data/uploadedImages/{row[2]}/{row[0]}/{row[1]}"
|
| 36 |
-
|
| 37 |
-
st.sidebar.image(img_path, width=100, caption=f"{row[0]} uploaded by {row[1]}")
|
| 38 |
-
sidebar_images.append(img_path)
|
| 39 |
else:
|
| 40 |
img_path = f"data/uploadedImages/{row[2]}/{row[0]}/{row[1]}"
|
| 41 |
st.image(img_path, width=100, caption=row[0])
|
|
@@ -58,10 +55,7 @@ if image_type == 'characters':
|
|
| 58 |
st.sidebar.write('**Characters**')
|
| 59 |
for name, files in uploaded_images['characters'].items():
|
| 60 |
for file in files:
|
| 61 |
-
|
| 62 |
-
if img_path not in sidebar_images:
|
| 63 |
-
st.sidebar.image(file, width=100, caption=f"{name} uploaded by {uploaded_file.name}")
|
| 64 |
-
sidebar_images.append(img_path)
|
| 65 |
else:
|
| 66 |
if uploaded_images['terrain']:
|
| 67 |
st.write('**Terrain**')
|
|
|
|
| 29 |
|
| 30 |
def display_images_from_csv():
|
| 31 |
files_info = get_uploaded_files_info()
|
|
|
|
| 32 |
for row in files_info:
|
| 33 |
if row[2] == 'characters':
|
| 34 |
img_path = f"data/uploadedImages/{row[2]}/{row[0]}/{row[1]}"
|
| 35 |
+
st.sidebar.image(img_path, width=100, caption=row[0])
|
|
|
|
|
|
|
| 36 |
else:
|
| 37 |
img_path = f"data/uploadedImages/{row[2]}/{row[0]}/{row[1]}"
|
| 38 |
st.image(img_path, width=100, caption=row[0])
|
|
|
|
| 55 |
st.sidebar.write('**Characters**')
|
| 56 |
for name, files in uploaded_images['characters'].items():
|
| 57 |
for file in files:
|
| 58 |
+
st.sidebar.image(file, width=100, caption=name)
|
|
|
|
|
|
|
|
|
|
| 59 |
else:
|
| 60 |
if uploaded_images['terrain']:
|
| 61 |
st.write('**Terrain**')
|