From 3b0a7bb34a5ab9eb291941286685d41c97b4af13 Mon Sep 17 00:00:00 2001 From: nicolai256 <68881396+nicolai256@users.noreply.github.com> Date: Fri, 9 Dec 2022 01:01:32 +0100 Subject: [PATCH] modified the dataloader for PIL errors and added progress bar --- ldm/data/data_loader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ldm/data/data_loader.py b/ldm/data/data_loader.py index debf7f0..f0abe20 100644 --- a/ldm/data/data_loader.py +++ b/ldm/data/data_loader.py @@ -1,8 +1,12 @@ import os from PIL import Image +import PIL import random from ldm.data.image_train_item import ImageTrainItem import ldm.data.aspects as aspects +from tqdm import tqdm + +PIL.Image.MAX_IMAGE_PIXELS = 933120000 class DataLoaderMultiAspect(): """ @@ -50,7 +54,7 @@ class DataLoaderMultiAspect(): """ decorated_image_train_items = [] - for pathname in image_paths: + for pathname in tqdm(image_paths): caption_from_filename = os.path.splitext(os.path.basename(pathname))[0].split("_")[0] txt_file_path = os.path.splitext(pathname)[0] + ".txt"