Skip to content

Commit

Permalink
add tqdm progress bar for monochromize_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cwmeijer committed Oct 15, 2024
1 parent 1472558 commit 3a5c178
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/segmentmytiff/utils/monochromize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import argparse
from pathlib import Path

from tqdm import tqdm

from segmentmytiff.main import read_geotiff, save_tiff


Expand Down Expand Up @@ -29,7 +31,7 @@ def monochromize_image(input_file_path: Path, output_folder_path: Path):

def monochromize_folder(input_folder: Path, output_folder: Path):
output_folder.mkdir(parents=True, exist_ok=True)
for input_file in input_folder.rglob('*.tif'):
for input_file in tqdm(list(input_folder.rglob('*.tif')), desc="Processing images"):
relative_path = input_file.relative_to(input_folder)
if input_file.is_file():
path = output_folder / relative_path.parent
Expand Down

0 comments on commit 3a5c178

Please sign in to comment.