support extensions of image files with uppercases

This commit is contained in:
Kohya S
2023-03-21 21:10:34 +09:00
parent 6d9f3bc0b2
commit 7b324bcc3b

View File

@@ -73,8 +73,7 @@ DEFAULT_LAST_OUTPUT_NAME = "last"
# region dataset # region dataset
IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".webp", ".bmp"] IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".webp", ".bmp", ".PNG", ".JPG", ".JPEG", ".WEBP", ".BMP"]
# , ".PNG", ".JPG", ".JPEG", ".WEBP", ".BMP"] # Linux?
class ImageInfo: class ImageInfo:
@@ -679,7 +678,7 @@ class BaseDataset(torch.utils.data.Dataset):
# ちょっと速くした # ちょっと速くした
print("caching latents.") print("caching latents.")
image_infos= list(self.image_data.values()) image_infos = list(self.image_data.values())
# sort by resolution # sort by resolution
image_infos.sort(key=lambda info: info.bucket_reso[0] * info.bucket_reso[1]) image_infos.sort(key=lambda info: info.bucket_reso[0] * info.bucket_reso[1])
@@ -713,7 +712,7 @@ class BaseDataset(torch.utils.data.Dataset):
if len(batch) > 0: if len(batch) > 0:
batches.append(batch) batches.append(batch)
# iterate batches # iterate batches
for batch in tqdm(batches, smoothing=1, total=len(batches)): for batch in tqdm(batches, smoothing=1, total=len(batches)):
images = [] images = []
for info in batch: for info in batch: