Spaces:
Runtime error
Runtime error
Daniel Verdu
commited on
Commit
•
2f2e4c6
1
Parent(s):
4c9d269
added progress bar
Browse files
app.py
CHANGED
@@ -132,6 +132,8 @@ def process_multiple_images(uploaded_files, img_size=800):
|
|
132 |
img_names_list = []
|
133 |
idx = 1
|
134 |
|
|
|
|
|
135 |
for idx, uploaded_file in stqdm(enumerate(uploaded_files, start=1), st_container=st_progress_bar):
|
136 |
st_title_message.markdown("**Processing image {}/{}. Please wait** ⌛".format(idx,
|
137 |
num_imgs))
|
@@ -151,6 +153,9 @@ def process_multiple_images(uploaded_files, img_size=800):
|
|
151 |
output_images_list.append(output_pil_img)
|
152 |
img_names_list.append(img_name.split('.')[0])
|
153 |
|
|
|
|
|
|
|
154 |
# Zip output files
|
155 |
zip_path = 'processed_images.zip'
|
156 |
zip_buf = zip_multiple_images(output_images_list, img_names_list, zip_path)
|
|
|
132 |
img_names_list = []
|
133 |
idx = 1
|
134 |
|
135 |
+
st_progress_bar.progress(0)
|
136 |
+
|
137 |
for idx, uploaded_file in stqdm(enumerate(uploaded_files, start=1), st_container=st_progress_bar):
|
138 |
st_title_message.markdown("**Processing image {}/{}. Please wait** ⌛".format(idx,
|
139 |
num_imgs))
|
|
|
153 |
output_images_list.append(output_pil_img)
|
154 |
img_names_list.append(img_name.split('.')[0])
|
155 |
|
156 |
+
percent = int((idx / num_imgs)*100)
|
157 |
+
st_progress_bar.progress(percent)
|
158 |
+
|
159 |
# Zip output files
|
160 |
zip_path = 'processed_images.zip'
|
161 |
zip_buf = zip_multiple_images(output_images_list, img_names_list, zip_path)
|