From 673f9ced4792607724669fd7edefcc11f3c6cddb Mon Sep 17 00:00:00 2001 From: Kohya S Date: Mon, 9 Jan 2023 21:06:58 +0900 Subject: [PATCH] Fix '*' is not working for DreamBooth --- library/train_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/train_util.py b/library/train_util.py index fcd9880d..7a0f794b 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -715,7 +715,10 @@ def debug_dataset(train_dataset): def glob_images(dir, base): img_paths = [] for ext in IMAGE_EXTENSIONS: - img_paths.extend(glob.glob(glob.escape(os.path.join(dir, base + ext)))) + if base == '*': + img_paths.extend(glob.glob(os.path.join(glob.escape(dir), base + ext))) + else: + img_paths.extend(glob.glob(glob.escape(os.path.join(dir, base + ext)))) return img_paths # endregion