diff --git a/exif_file.py b/exif_file.py index bae37c8..e8cd69f 100644 --- a/exif_file.py +++ b/exif_file.py @@ -98,6 +98,7 @@ def main(args): else: raise Exception("No output or image_destination specified") + if __name__ == "__main__": try: total_tic = time() diff --git a/images/images.py b/images/images.py index d0ae1b9..0eb2f84 100644 --- a/images/images.py +++ b/images/images.py @@ -31,6 +31,7 @@ def process_raw(dng_file, half_size=False, auto_white_balance=False): return image + def process_image(image_path, half_size=False, auto_white_balance=False): if image_path.endswith("dng"): image = process_raw(image_path, half_size, auto_white_balance) @@ -66,7 +67,7 @@ def resize_images(images): print(f"Skipping image due to aspect ratio: {image.shape}") else: resized_images.append(image) - + return resized_images @@ -91,9 +92,14 @@ def loadImages(path, threads=None, half_size=False, auto_white_balance=False): # Instead of appending, concatenate the result images to numpy_array with ProcessPoolExecutor(max_workers=workers) as executor: if file_list: - for result_image in executor.map(process_image, file_list, [half_size] * len(file_list), [auto_white_balance] * len(file_list)): + for result_image in executor.map( + process_image, + file_list, + [half_size] * len(file_list), + [auto_white_balance] * len(file_list), + ): images.append(result_image) - + images = resize_images(images) return np.array(images) diff --git a/utils/utils.py b/utils/utils.py index 81ea39a..51694ca 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -24,7 +24,7 @@ def files(path: str) -> list: process_file_list.append(os.path.join(path, file)) # Allow other unncompressed formats to be processed elif file.endswith("png"): - # exclude all that include main in the name to + # exclude all that include main in the name to # avoid processing processed images if "main" not in file: process_file_list.append(os.path.join(path, file))