make sure undersized image is utf8
This commit is contained in:
parent
b9f4a6d657
commit
59f14656fe
2
train.py
2
train.py
|
@ -312,7 +312,7 @@ def report_image_train_item_problems(log_folder: str, items: list[ImageTrainItem
|
|||
underized_log_path = os.path.join(log_folder, "undersized_images.txt")
|
||||
logging.warning(f"{Fore.LIGHTRED_EX} ** Some images are smaller than the target size, consider using larger images{Style.RESET_ALL}")
|
||||
logging.warning(f"{Fore.LIGHTRED_EX} ** Check {underized_log_path} for more information.{Style.RESET_ALL}")
|
||||
with open(underized_log_path, "w") as undersized_images_file:
|
||||
with open(underized_log_path, "w", encoding='utf-8') as undersized_images_file:
|
||||
undersized_images_file.write(f" The following images are smaller than the target size, consider removing or sourcing a larger copy:")
|
||||
for undersized_item in undersized_items:
|
||||
message = f" *** {undersized_item.pathname} with size: {undersized_item.image_size} is smaller than target size: {undersized_item.target_wh}\n"
|
||||
|
|
Loading…
Reference in New Issue