fffiloni commited on
Commit
5aadbc3
·
verified ·
1 Parent(s): 776271d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
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 the image extensions you want to search for
17
- image_extensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] # Add more if needed
18
 
19
  # Create a list to store the image file paths
20
  image_paths = []
21
 
22
- # Iterate through the specified image extensions and get the file paths
23
- for ext in image_extensions:
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
- # Now image_paths contains the list of all image file paths
28
- #print(image_paths)
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