[dreambooth] Using already created `Path` in dataset (#681)

using already created `Path` in dataset
This commit is contained in:
Pierre LeMoine 2022-10-05 12:14:30 +02:00 committed by GitHub
parent a8a3a20d36
commit 08d4fb6e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -244,7 +244,7 @@ class DreamBoothDataset(Dataset):
if class_data_root is not None:
self.class_data_root = Path(class_data_root)
self.class_data_root.mkdir(parents=True, exist_ok=True)
self.class_images_path = list(Path(class_data_root).iterdir())
self.class_images_path = list(self.class_data_root.iterdir())
self.num_class_images = len(self.class_images_path)
self._length = max(self.num_class_images, self.num_instance_images)
self.class_prompt = class_prompt