mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 14:34:23 +00:00
Update train_util.py
This commit is contained in:
@@ -906,10 +906,14 @@ class FineTuningDataset(BaseDataset):
|
|||||||
if os.path.exists(image_key):
|
if os.path.exists(image_key):
|
||||||
abs_path = image_key
|
abs_path = image_key
|
||||||
else:
|
else:
|
||||||
# わりといい加減だがいい方法が思いつかん
|
npz_path = os.path.join(glob.escape(train_data_dir), image_key + ".npz")
|
||||||
abs_path = glob_images(subset.image_dir, image_key)
|
if os.path.exists(npz_path):
|
||||||
assert len(abs_path) >= 1, f"no image / 画像がありません: {image_key}"
|
abs_path = npz_path
|
||||||
abs_path = abs_path[0]
|
else:
|
||||||
|
# わりといい加減だがいい方法が思いつかん
|
||||||
|
abs_path = glob_images(subset.image_dir, image_key)
|
||||||
|
assert len(abs_path) >= 1, f"no image / 画像がありません: {image_key}"
|
||||||
|
abs_path = abs_path[0]
|
||||||
|
|
||||||
caption = img_md.get('caption')
|
caption = img_md.get('caption')
|
||||||
tags = img_md.get('tags')
|
tags = img_md.get('tags')
|
||||||
|
|||||||
Reference in New Issue
Block a user