Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import numpy as np
|
| 3 |
import os
|
| 4 |
import shutil
|
| 5 |
import zipfile
|
|
@@ -59,10 +58,11 @@ if uploaded_file:
|
|
| 59 |
|
| 60 |
# Show transformation steps
|
| 61 |
st.subheader("🧬 Steps Preview")
|
| 62 |
-
|
|
|
|
| 63 |
for i, file in enumerate(sorted(os.listdir(output_dir))):
|
| 64 |
img = Image.open(os.path.join(output_dir, file))
|
| 65 |
-
with cols[i %
|
| 66 |
st.image(img, caption=file[:-4], width=180)
|
| 67 |
|
| 68 |
# Create ZIP
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import os
|
| 3 |
import shutil
|
| 4 |
import zipfile
|
|
|
|
| 58 |
|
| 59 |
# Show transformation steps
|
| 60 |
st.subheader("🧬 Steps Preview")
|
| 61 |
+
num_cols = max(1, min(3, len(options))) # fix for columns error
|
| 62 |
+
cols = st.columns(num_cols)
|
| 63 |
for i, file in enumerate(sorted(os.listdir(output_dir))):
|
| 64 |
img = Image.open(os.path.join(output_dir, file))
|
| 65 |
+
with cols[i % num_cols]:
|
| 66 |
st.image(img, caption=file[:-4], width=180)
|
| 67 |
|
| 68 |
# Create ZIP
|