Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,22 +10,18 @@ import time
|
|
10 |
import threading
|
11 |
import argparse
|
12 |
|
13 |
-
|
14 |
-
|
15 |
def list_iter_images(save_dir):
|
16 |
-
# Specify
|
17 |
-
|
18 |
|
19 |
# Create a list to store the image file paths
|
20 |
image_paths = []
|
21 |
|
22 |
-
#
|
23 |
-
|
24 |
-
# Use glob to find all image files with the given extension
|
25 |
-
image_paths.extend(glob.glob(os.path.join(save_dir, f'*.{ext}')))
|
26 |
|
27 |
-
#
|
28 |
-
|
29 |
|
30 |
return image_paths
|
31 |
|
|
|
10 |
import threading
|
11 |
import argparse
|
12 |
|
|
|
|
|
13 |
def list_iter_images(save_dir):
|
14 |
+
# Specify only PNG images
|
15 |
+
image_extension = 'png'
|
16 |
|
17 |
# Create a list to store the image file paths
|
18 |
image_paths = []
|
19 |
|
20 |
+
# Use glob to find all PNG image files
|
21 |
+
all_images = glob.glob(os.path.join(save_dir, f'*.{image_extension}'))
|
|
|
|
|
22 |
|
23 |
+
# Filter out 'best_image.png'
|
24 |
+
image_paths = [img for img in all_images if os.path.basename(img) != 'best_image.png']
|
25 |
|
26 |
return image_paths
|
27 |
|